sql查询中自动统计某项数量

select * from dbo.Vehicle_Maintain_Details A inner join (
select MaintainType as tempTypeName,count(ID) as num from dbo.Vehicle_Maintain_Details group by MaintainType) B 
on A.MaintainType=B.tempTypeName

  

posted @ 2013-01-09 17:59  +-/\-+  阅读(968)  评论(0编辑  收藏  举报