im using the foloowing query with case statement--
SELECT case WHEN t1.abc !='' THEN 1 ELSE 0 END as ids FROM
table1 AS t1 LEFT JOIN table2 as t2
ON t1.pid = t2.id
WHERE t2.idr IS NULL and t1.idr=23
in it im getting 1 in ids when query returns a row but when query returns nothing then 0 is not returned.why is that so??
What i need is that when query returns a row it should return 1 and if no result is shown then it should return 0. where am i going wrong??