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语句,然后再执行才会得到数据;其实这个看起来算是一个然并卵的东西,记录一下知道有这么个东西。

posted on 2020-09-23 23:32  神奇的旋风  阅读(9912)  评论(0编辑  收藏  举报

导航