关联3个表的SQL语句怎样写?

发布网友 发布时间:2024-10-21 17:38

我来回答

3个回答

热心网友 时间:5分钟前

select a.a1,a.a2 from a,b,c where a1=b1 and b2=c2 group by a.a1,a.a2
having sum(c.c3)>100

-----------------------------
select a.a1,a.a2,sum(c.c3) from a,b,c where a1=b1 and b2=c2 group by a.a1,a.a2
having sum(c.c3)>100

热心网友 时间:8分钟前

select tb1.A1,tb1.A2 from
(
select A.A1,A.A2,B.B1 from A left join B on A.A1=B.B1
) as tb1
left join
(
select C.C2,SUM(C3) as 判断字段 from C group by C2 where 判断字段>100
)
on tb1.B1=C.C2

热心网友 时间:2分钟前

山炮

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