sql数据库中多表如何统计总数

2025-03-24 10:21:35
推荐回答(4个)
回答1:

select * from A inner join B on (A.Id=B.Aid) where A.age<16 and B.所选课程=数学
(A.Id=B.Aid)是A表和B表的关系
Sql语句是这样的

回答2:

做表连接后COUNT,看你外连内连前连后连了,总数会因连接方式不同而不同。

回答3:

sql="select * from A表 where A.年龄<16 and B.课程='数学'"

回答4:

select * from A a inner join B b on(a.id=b.id) where a.age<16 and b.课程='数学'