这个查找语句如何写

这个查找语句怎么写?我想查找ApplyInfo表中每个SceneId中ApplyNumber的总和,但是要显示的是SceneInfo表中S

这个查找语句怎么写?


我想查找ApplyInfo表中每个SceneId中ApplyNumber的总和,但是要显示的是SceneInfo表中SceneName,这个语句怎么写?

[解决办法]

SQL code
select a.SceneName,isnull(b.s,0) as SumApplyNumberfrom SceneInfo aleft join  (select SceneId,sum(pplyNumber) as s from ApplyInfo group by SceneId) bon a.SceneId=b.SceneId