美文网首页
mysql纵列转横列

mysql纵列转横列

作者: 秋元_92a3 | 来源:发表于2022-08-14 19:56 被阅读0次

sql 超级无敌纵列转横列

select GROUP_CONCAT(bb)
from (
select 1 as aa,concat(
               substr(f_start_time, 1, 2), ':', substr(f_start_time, 3, 2),
               '-',
               substr(f_end_time, 1, 2), ':', substr(f_end_time, 3, 2), ':', f_elec_price) bb
from fp_pile_station.t_charge_policy
where f_equipment_id = '1101010000200302'
  and f_yn = 1) t group by t.aa;

相关文章

网友评论

      本文标题:mysql纵列转横列

      本文链接:https://www.haomeiwen.com/subject/cqslgrtx.html