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
´ó¼ÒºÃ£¬ÇëÎÊÔÚ±íMÖÐÓÐ×ֶΣºa b c d e ÎÒÏë²é³öÆäÖÐÂú×ãÏÂÃæÈÎÒâÒ»ÏîµÄÊý¾Ý£¬1.×Ö¶Îa µÄÖµ²»ÊÇ ¡®Êé»ò±Ê»ò±¾¡¯ÖÐÈÎÒ»£¬2.aΪÊéµÄʱºò×Ö¶Îb,cÊÇ¿Õ;3.µ±aֵΪ±ÊµÄʱºòdÊÇ¿Õ;4.µ±aΪ±¾µÄʱºòb,d,e¶¼ÊÇ¿Õ;5.È ......
ÏÖÔÚÓÐÒ»ORACLEÖеÄSQLÓï¾ä£¬ÐèÒªÒÆÖ²µ½DB2ÖУ¬ÇëÎʸÃSQL¸ÄÈçºÎд ORACLEÖУº select floor(months_between(date1,date2)) from A date1,date2·Ö±ðΪ±íÖеÄÁ½¸ö×Ö¶Î £¬¶¼ÎªÈÕÆÚÐÍ DB2ÖÐÈçºÎʹÓÃÐ ......