品易云推流 关闭
文章详情页
文章 > MySQL > mysql如何判断是否存在某个字段

mysql如何判断是否存在某个字段

头像

yang

2020-04-13 13:17:355022浏览 · 0收藏 · 0评论

判断表中一个字段是否存在的方法:

语法:

select count(*) from information_schema.columns where table_name = '表名' and column_name = '字段名'

sql例子:

select count(*) from information_schema.columns where table_name = 't_iov_vehicle_owner_info' and column_name = 'id'

推荐:MySQL教程

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图