Last active
January 25, 2018 09:59
-
-
Save kidinamoto01/0ae5341f00c99543e35820142a77faa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//select count(*) from language | |
var count int | |
db.Model(&Language{}).Select("count(distinct id)").Count(&count) | |
fmt.Println("count: ",count) | |
models.DB.Model(&models.UserInvitation{}).Select("count(distinct(invitee_id))").Where("invitation_code = ?", "abcd").Count(&result) | |
fmt.Println("count result: ",result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment