我正在使用DB2数据库.什么是合适的SQL查询来查明表或表列表中是否存在列?
例如
if "column_name" is found in "table name" or [list of table names] return true or the name of tables that have that column.
非常感谢.
解决方法
使用
SYSCAT.COLUMNS
catalog view:
SELECT TABNAME FROM SYSCAT.COLUMNS WHERE TABNAME IN ('table name 1','table name 2') AND COLNAME = 'column_name';