Answer the question
In order to leave comments, you need to log in
How to add an IF condition in MySQL?
There is such a sign:
I want to make such a request. If date is less than today, then UPDATE quey to value 1000, and then the usual SELECT id, date, etc. otherwise, just SELECT
But no matter how I twist with conditions and subqueries, it doesn’t work out, for example:SELECT IF(`date` < NOW()) `id`, `query`, `date`
Answer the question
In order to leave comments, you need to log in
Update.... where query from your if? So not satisfied? And if it doesn’t fit at all, you can use built-in functions and describe anything there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question