【Oracle字典表应用】利用字典表查表是否存在

【Oracle SQL】

一行流方式:

select count(*) from all_tables where table_name=upper('your tableName')

层次化方式:

select count(*) 
from all_tables 
where table_name=upper('your tableName')

 

【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

posted @   逆火狂飙  阅读(25)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2021-08-19 我想对2016年的自己说
2017-08-19 【Canvas与艺术】生化大桶
2013-08-19 【高中数学/导数/极值】当x>0时,求x^2-x+1/x的最小值
2013-08-19 【Canvas与函数图像】y=x+Math.pow(2-x*x*x,1/3)
2013-08-19 【Canvas与图标】金边蓝底股票走势图标
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东
点击右上角即可分享
微信分享提示