mysql 排除某个字段的sql语句


select concat('select ',group_concat(case when column_name in('id','hot') then null else column_name end),' from city;') from information_schema.columns where table_schema='email' and table_name='city';

以上得出来的是一个sql语句,排除了id,hot ,仅仅是得出了sql语句,然后再执行才会得到数据;其实这个看起来算是一个然并卵的东西,记录一下知道有这么个东西。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM