码迷,mamicode.com
首页 > 其他好文 > 详细

列统一给别名

时间:2019-11-07 11:26:58      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:when   group   别名   attach   sel   select   inf   ali   tac   

select GROUP_CONCAT(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

列统一给别名

标签:when   group   别名   attach   sel   select   inf   ali   tac   

原文地址:https://www.cnblogs.com/138026310/p/11810853.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!