发布网友 发布时间:2022-04-26 18:16
共1个回答
热心网友 时间:2023-10-20 13:05
确定是要用sql写?
感觉没啥意义的说?
select "起:"||hhmm_from||"_止:"hhmm_end as setime
,max(case when weekday=1 then course) as Monday
,max(case when weekday=2 then course) as Tuesday
,max(case when weekday=3 then course) as Wednesday
,max(case when weekday=4 then course) as Thursday
,max(case when weekday=5 then course) as Friday
from table1 t1
left join table2 t2
on t1.id = t2.lessionid
group by "起:"||hhmm_from||"_止:"hhmm_end