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

473次阅读
没有评论

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

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

语法:

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教程

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:Python教程2022-10-19发表,共计286字。
新手QQ群:570568346,欢迎进群讨论 Python51学习