使用如下sql出错:
select tableA.period as hour,tableB.brw,tableB.pla...
from tableB
full join tableA on tableA.period=tableB.hou如果写成 RIGHT JOIN 可以,但是tableB中的hou=NULL的数据就会丢失,请教大神!!!
select tableA.period as hour,tableB.brw,tableB.pla...
from tableB
full join tableA on tableA.period=tableB.hou如果写成 RIGHT JOIN 可以,但是tableB中的hou=NULL的数据就会丢失,请教大神!!!
select a.*,(case when b.brw is not null then b.brw else 0 end)brw from
(
select period as `hour` from tableA
union all
select null
)a
left join tableB b
on a.`hour` = b.hou
//b表的其它字段跟 brw 类似