db2 判断一个表的一个字段是否存在1
发布网友
发布时间:2023-11-13 04:13
我来回答
共1个回答
热心网友
时间:2024-12-02 11:40
db2 "select 1 from syscat.columns where colname='COL1' and tabname='TAB1' and tabschema='SCH1'"
例如:
db2 "select 1 from syscat.columns where colname='ID' and tabname='STAFF' and tabschema='E97Q9A'"
$ ere colname='ID' and tabname='STAFF' and tabschema='E97Q9A'" <
1
-----------
1
1 record(s) selected.