列统一给别名

select GROUP_CONCAT(t.alise,'.',t.column_name,' \'',t.alise,'__',t.column_name,'\'') from (

select column_name ,
(case table_name
when 'news' then 'n'
when 'news_attachment' then 'na' else '' end) alise
from
information_schema.`COLUMNS`
where table_schema = 'ecs_news'
and table_name in ( 'news','news_attachment' )

) t

posted @ 2019-11-07 11:12  小姐姐别这样  阅读(112)  评论(0)    收藏  举报