mysql 如果把多个搜索的结果合并成多个列?

mysql 如果把多个搜索的结果合并成多个列?,第1张

select tmp.t1,tmp.t2

from

(select 字段名 as t1,null as t2

from 表名)

union

(select null as t1,字段名 as t2

from 表名

)tmp

您好.以前有高人写过类似的:select id,group_concat(re_id order by re_id separator ",") as re_idfrom tablenamegroup by id方法2:select group_concat(list_name) from aa_list如果还有问题,可以继续追问,感谢。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7520314.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-06
下一篇 2023-04-06

发表评论

登录后才能评论

评论列表(0条)

保存