两表联查的sql语句

发布网友 发布时间: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

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com