Last active
June 13, 2024 01:35
-
-
Save rdeavila/9214654 to your computer and use it in GitHub Desktop.
PostgreSQL: Lista todas as tabelas que tem um determinado campo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
TABLE_NAME AS TABELA, | |
COLUMN_NAME AS CAMPO | |
FROM | |
INFORMATION_SCHEMA.COLUMNS | |
WHERE | |
COLUMN_NAME LIKE 'nome_campo%' -- Exemplo: 'id_empresa%' | |
AND COLUMN_NAME <> 'nome_campo_exclusao' -- Exemplo: 'id_empresaerp' | |
ORDER BY | |
TABELA ASC |
ohhhh!! this save me! thanks!
thanks!!
Amigo obrigado pela ajuda, salvou minhas buscas.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muito útil. Obrigado!