Skip to content

IF condition #844

@linfiesto

Description

@linfiesto

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions