Hello,
I wrote the following statement:
SELECT CASE
WHEN (SELECT count(*) FROM employee where empno='000010') >0 THEN
'true'
ELSE 'false'
END AS isExist
from employee where empno='000010'
My problem is that when the empno exists everything is ok but when it
does not exist I got no record becuase of the last where cluase.
How can I rewrite this statement in order to get true when exists and
false when it does not exist?
Thanks
I wrote the following statement:
SELECT CASE
WHEN (SELECT count(*) FROM employee where empno='000010') >0 THEN
'true'
ELSE 'false'
END AS isExist
from employee where empno='000010'
My problem is that when the empno exists everything is ok but when it
does not exist I got no record becuase of the last where cluase.
How can I rewrite this statement in order to get true when exists and
false when it does not exist?
Thanks
Comment