以Oracle為示例:
exists(select 1 from all_tables u where 條件壹:限制用戶名 and 條件二:限制表名)
查詢系統字典表all_tables,判斷表是否存在,存在則結果為真;不存在則結果為假
通過結合if語句使用:
if exists(select 1 from all_tables u where 條件壹:限制用戶名 and 條件二:限制表名) then 執行子句壹
else 執行子句二;