Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

IF condition #844

Open
linfiesto opened this issue Jul 3, 2019 · 0 comments
Open

IF condition #844

linfiesto opened this issue Jul 3, 2019 · 0 comments

Comments

@linfiesto
Copy link

linfiesto commented Jul 3, 2019

Hi, sorry but I'm somehow confused on how to exactly do query condition for IF and IS NULL

I have this particular SQL query but not sure how to convert it to ORM.

WHERE
has_sent = 0
AND
messenger_messages.create_date >= IF(users.last_login IS NULL, ( Curdate() - interval 1 month ), users.last_login + interval 5 minute)

Hope you can help. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant