if select * from table where x=1
returns 0 rows, then I need select * from table where x=2 [or some other query]
. Is it possible to do this in a si
The simplest explanation is that:
SELECT IF(1 = 2,'true','false'); --> false
SELECT IF(1 = 1,' true','false'); --> true
SELECT IF(1 = 2,' true','false'), IF(1 = 1,' true','false'); --> false | true
The 'if' statement give some functionality to selected values. The structure is something like this:
SELECT IF(), ...... FROM
A great explanation can be found here.