I need to return true or false rather than 1 & 0, using following query:
true
false
1
0
select if(u.id is null,false
IF()
You are missing single quotes.
select if(u.id is null,'false','true') status from user u limit 10;