select a.strno,a.strnam,b.sum(score) from (select strno,strnam from name where strnam >2) a, (select strno,sum(score) from score where strdate>'1-1ÔÂ-2009' group by strno having sum(score)>300) b where a.strno=b.strno group by a.strno,a.strnam
±íAÖÐÊÇѧºÅºÍѧÃû£¬±íBÖÐÊÇѧºÅºÍ³É¼¨£¬ÎÒÏëÊä³öÒ»ÕŽñÄêѧÃû´óÓÚ2¸ö×ֵ쬳ɼ¨´óÓÚ300·ÖµÄ±í¸ñ¡£ µ«ÊÇÖ´Ðкó×ÜÊDZ¨´í£¬b.sum(score) ÊÇÎÞЧ±êʶ·û£¬Çë¸÷λָµãһϰÉsum([b].[score]) SQL code: select a.strno,a.strnam,sum(b.score) from (select strno,strnam from name where strnam >2) a, (select strno,sum(score) from score where strdate>'1-1ÔÂ-2009' group by strno having sum(score)>300) b where a.strno=b.strno group by a.strno,a.strnam
sum(b.score)Ó¦¸ÃÒ²¿ÉÒÔ,×ÜÖ®sumÊǺ¯Êý,Ó¦¸Ã·ÅÔÚÍâÃæ,Ò²¿ÉÒÔ¼ÓasÆð¸ö±ðÃû,±ÈÈç:sum(b.score) as bscore
SQL code: select a.strno , a.strnam , sum(b.score) from (sel