扫一扫
关注微信公众号

如何用SQL计算两个独立的表格
2007-10-22   IT专家网

 我需要统计运算两个以上的表格:  

SELECT T1.city,
(select count(*) from T2 where T1.id=T2.id )
as totbooks ,
(select count(*) from T3 where T1.id=T3.id
and descr like '%newspaper%' )
as totnewspaper
FROM T1
group by T1.description

热词搜索:

上一篇:SQL查询一年中的所有星期五
下一篇:如何从SQL表中删除数据

分享到: 收藏