-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditions for Joins #6842
Comments
I found a different way for condition |
maybe you can do this
|
@wxy2077 yeah but i need Where conditions for Joins |
How can I write conditions for InnerJoins, above solutions aren't work |
@zuzuviewer I don't know about InnerJoins, but this worked for Joins |
I have tried it with 1.25.5. It didn't work and not in join condition |
I found a way to resolve: tx.InnerJoin("Company",db.Table("company").Where("id = ?",id))` |
Hi! How can I write conditions for Joins? I need something like this
Joins("UserProgram", "currency_id = ? AND activated IS NOT NULL AND finished IS NULL AND error IS NULL", currencyID)
But it wont work, this type of conditions works only with Preload. And I do not want to write whole table names and stuff, like
Joins("promo_usergrogram on promo_userprogram.user_program_id = ...").Where("promo_usergrogram.currency_id = ? ...")
In documentation we have
db.Joins("Company", DB.Where(&Company{Alive: true})).Find(&users)
But how can I use it for condition like
activated (time type) IS NOT NULL AND finished(time type) IS NULL AND error (string type) IS NULL
The document you expected this should be explained
https://gorm.io
The text was updated successfully, but these errors were encountered: