其他分享
首页 > 其他分享> > 【pg】查表是否存在

【pg】查表是否存在

作者:互联网

【PG SQL】

一行流方式:

select count(*) from information_schema.table where table_schema='your schema' and table_type='BASE TABLE' and upper(table_name)=upper('your tableName')

层次化方式:

select count(*) 
from information_schema.table 
where 
table_schema='your schema' and 
table_type='BASE TABLE' and 
upper(table_name)=upper('your tableName')

END

标签:upper,查表,是否,tableName,pg,table,your,select,schema
来源: https://www.cnblogs.com/pyhy/p/16600717.html