Skip to content

Instantly share code, notes, and snippets.

@davidwaterston
Created September 18, 2012 06:35
Show Gist options
  • Save davidwaterston/3741590 to your computer and use it in GitHub Desktop.
Save davidwaterston/3741590 to your computer and use it in GitHub Desktop.
MySQL: Check if a table contains any data
select 1
from __table_name__
limit 1
@davidwaterston
Copy link
Author

This will return one row if table_name contains any data and no rows if it doesn't.

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