I am facing a problem when writing a case statement,
Here is the sample query
Case when (select count(*)from ABC) >'0' then 'Data is available' else 'No data' end
It is giving me a syntax error '3706: Expected something between > and '0'.
Can someone please suggest what I am doing wrong here.
The above case statement looks fine. If would give the result as 'Data is Available' if the count(*) > 0.
do you try to run this as a standalone query?
select Case when (select count(*)from ABC) >'0' then 'Data is available' else 'No data' end
select Case when count(*) >'0' then 'Data is available' else 'No data' end