Skip to content

Instantly share code, notes, and snippets.

@juyal-ahmed
Last active May 9, 2019 15:26
Show Gist options
  • Save juyal-ahmed/8823fd88f4f774ce1c7fc812c5490877 to your computer and use it in GitHub Desktop.
Save juyal-ahmed/8823fd88f4f774ce1c7fc812c5490877 to your computer and use it in GitHub Desktop.
Search for a specific column name in all the tables in MySQL database?
SELECT    
    table_name, 
    ordinal_position    
FROM INFORMATION_SCHEMA.COLUMNS    
WHERE    
    table_schema = 'DB_NAME' AND    
    column_name='column_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment