How to conditionally raise an error in MySQL without stored procedure
Retrieve column from a table with multiple rows in the else part

select case when foo = "bar" then 1 else (select table_name from information_schema.tables) end;


As an example, let's use @foo instead of foo

mysql&gt; select case when @foo = "bar" then 1 else (select table_name from information_schema.tables) end;
ERROR 1242 (21000): Subquery returns more than 1 row


Give it a Try !!