Skip to content

Instantly share code, notes, and snippets.

@barryparkin
Last active February 13, 2024 11:44
Show Gist options
  • Save barryparkin/9089296 to your computer and use it in GitHub Desktop.
Save barryparkin/9089296 to your computer and use it in GitHub Desktop.
(sqlite) Find table in database by field name
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME like '%{{fieldname}}%'
AND TABLE_SCHEMA = {{Database}};
@ixzh
Copy link

ixzh commented Mar 8, 2021

Only fieldname has to be included

I just realised sqlite_master is a special table where sql is the last column with the CREATE statement text. Thanks !!

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