Using if statement outside of a stored procedure or function
Use the IF() function

mysql&gt; set @the_message = 'Rolando Bank of America';
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SELECT IF(@the_message LIKE '%Bank%','h','nothing here to see') result;
+--------+
| result |
+--------+
| h      |
+--------+
1 row in set (0.00 sec)

mysql&gt; set @the_message = 'Rolando Bk of America';
Query OK, 0 rows affected (0.00 sec)

mysql&gt; SELECT IF(@the_message LIKE '%Bank%','h','nothing here to see') result;
+---------------------+
| result              |
+---------------------+
| nothing here to see |
+---------------------+
1 row in set (0.00 sec)

mysql&gt;


Give it a Try !!!