tags:

views:

38

answers:

1

i would like to query a MySql Database to show me all the existing databases based on provided condition (condition applied on the database name). now since my condition is complex, the simple "LIKE" condition is not enough, and i need to use the regular WHERE clause.

can anyone provide a sample of how to do that?

+3  A: 
USE INFORMATION_SCHEMA;
SELECT `SCHEMA_NAME` from `SCHEMATA` WHERE `SCHEMA_NAME` LIKE "%whatever%";

Read more in the docs.

gnud