数据库|mysql教程
代码片段,代码分享,PHP代码分享,Java代码分享,Ruby代码分享,Python代码分享,HTML代码分享,CSS代
数据库-mysql教程
常用数据库查询判断表和字段是否存在的SQL(如果结果为1表示存在,为0表示不存在)
java小项目源码,ubuntu系统怎么分屏,部署tomcat的几种方式,py爬虫解压,php上传视频接口,网络营销seo关键词优化外包lzw
1、MSSQL Server
表:
a*算法源码,vscode格式化双引号,怎么导入ubuntu,tomcat加载不了项目,amazon 爬虫集群,php写到文件,seo广告优化的发展前景,自己电脑建网站lzw
SELECT COUNT(*) FROM dbo.sysobjects WHERE name= able_name;
字段:
3d柱状图源码,vscode清理内存,ubuntu tqdm,tomcat优化java,sqlite3 锁机制,织梦cms淘宝客插件,做大型网站用什么前端框架,泰兴有没有爬虫店卖,jquery 获取php,繁昌企业seo优化,如何制作一个静态网站源码,js简单网页特效,时尚服装模板lzw
SELECT COUNT(*) FROM syscolumns WHERE id=object_id(‘table_name’) AND name= column_name;
2、My SQL
表:
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = able_name;
字段:
SELECT COUNT(*) FROM information_schema.columns WHERE table_name = able_name AND column_name =column_name;
3、Oracle
表:
SELECT count(*) FROM USER_OBJECTS WHERE OBJECT_NAME = able_name;
字段:
SELECT COUNT(*) FROM USER_TAB_COLUMNS WHERE TABLE_NAME = able_name AND column_name =column_name;
4、PostgreSql
表:
SELECT count(*) FROM information_schema.tables WHERE table_schema= able_schema AND table_name = able_name;
字段:
SELECT count(*) FROM information_schema.columns WHERE table_schema= able_schema AND table_name = able_name AND column_name=column_name;
如果觉得《常用数据库查询判断表和字段是否存在的SQL》对你有帮助,请点赞、收藏,并留下你的观点哦!