首页 > 编程学习 > 【pg】查表是否存在

【pg】查表是否存在

发布时间:2022/8/19 6:09:02

【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

Copyright © 2010-2022 mfbz.cn 版权所有 |关于我们| 联系方式|豫ICP备15888888号