日期:2014-05-18 浏览次数:20452 次
select b.* from car as a inner join b on a.id=b.carid where DepartmentID = 1
------解决方案--------------------
使用两个表进行连接查询即可
------解决方案--------------------
子查询:
select * from b where carid in (select ID from a where DepartmentID = 1))
联接查询:
select b.* from b inner join a on b.carid=a.ID and a.DepartmentID=1
------解决方案--------------------
用子查询
------解决方案--------------------
子查询:
select * from b where carid in (select ID from a where DepartmentID = 1))
联接查询:
select b.* from b inner join a on b.carid=a.ID and a.DepartmentID=1