When writing a query, can I reference the current database’s name, sort of like with the this keyword in Java? I am writing a script that I will run against several similar databases, and I need to query the information_schema.KEY_COLUMN_USAGE table with the CONSTRAINT_SCHEMA column in my WHERE clause.
When writing a query, can I reference the current database’s name, sort of like
Share
SELECT DATABASE()gives you the selected databasehttp://dev.mysql.com/doc/refman/5.0/en/creating-database.html