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 want, you can return the values as strings:
SELECT IF(u.id IS NULL, 'false', 'true') as status FROM user u LIMIT 10