Skip to content

Instantly share code, notes, and snippets.

@davidwaterston
Created September 18, 2012 08:54
Show Gist options
  • Save davidwaterston/3742116 to your computer and use it in GitHub Desktop.
Save davidwaterston/3742116 to your computer and use it in GitHub Desktop.
MySQL: Check if a table exists - version 3
select table_name as found
from information_schema.tables
where table_schema = SCHEMA()
and table_name = '__table_name__'
@davidwaterston
Copy link
Author

Use this version when you are not sure what the current schema will be when this query runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment