Answer the question
In order to leave comments, you need to log in
How to use if or other check in a query?
The bottom line is we take a bunch of fields
SELECT orders, users, ....
FROM .....
WHERE
and here we need to do something, if IF client.contact = 'phone' && client.r !='' then client.r = user.id
is it possible to do this?
Answer the question
In order to leave comments, you need to log in
SELECT
IF(client.contact = 'phone' AND client.r <>'', user.id, client.r) as value ...
FROM ...
WHERE
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question