tags:

views:

294

answers:

1

Hi, I have a query which contains a subquery which is something like this

IFNULL((SELECT id FROM mytable WHERE id = 1), 'No')

It works OK, but I would like to return the string 'Yes' on success rather than the actual id of the row.

Is there any way to override the value it returns?

Thanks.

+4  A: 
IFNULL((SELECT 'Yes' FROM mytable WHERE id = 1), 'No')
Jan Hančič
+ 1 beat me by 26 sec ;)
Felix Kling