ÓÐÕâÑùÒ»Õűí ÀàÐÍ ½ð¶î a 10 a 20 b 10 a 30 b 30 ÎÒÏëͨ¹ýÒ»ÌõsqlÓï¾äͬʱ²éѯ³öaµÄ½ð¶î×ܺͺÍbµÄ½ð¶î×ܺÍSQL code: select ÀàÐÍ,sum(½ð¶î)½ð¶î from tb group by ÀàÐÍ
SQL code: select ÀàÐÍ,SUM(½ð¶î) from tb group by ÀàÐÍ
SQL code: select sum(case ÀàÐÍ when a then ½ð¶î else 0 end) as 'a', sum(case ÀàÐÍ when a then ½ð¶î else 0 end) as 'b' from tb
SQL code: select sum(case ÀàÐÍ when a then ½ð¶î else 0 end) as 'a', sum(case ÀàÐÍ when b then ½ð¶î else 0 end) as 'b' from tb
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......