ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¥ÎVBA¦Û¤v¿z¿ï ÁÙ¬O¥Î¤@¯ë¤è¦¡³B²z?

[µo°Ý] ¥ÎVBA¦Û¤v¿z¿ï ÁÙ¬O¥Î¤@¯ë¤è¦¡³B²z?

·Q½Ð°Ý¤@¤U¤j®a
¦³¿ìªk±N ªþ¥[Àɮפ¤ ¨C¤é¥Í²£¤u®É/²£­È ¨ºÃ䪺¤º®e
¥t¥~°µ¤@­ÓSHEETS ¹³ [¨C¤é³øªí] ¨º¼Ë
¦pªG¦b[¨C¤é³øªí]¿é¤J¤é´Á µM«á ¾Þ§@­ûªº  ¶}©l®É¶¡ µ²§ô®É¶¡ Á`¤u®É ¥ð®§®É¶¡  ¤u®É®t ²£­È
¯à¦Û¤v¶]¥X¨Ó¥[Á`¶Ü

§Ú¦³¸Õ¹L¥Î¼Ï¯Ã¤ÀªRªí ¤£¹L¸ê®Æ¸ò¦Û¤v¥[Á`ªº¤£¤Ó¹ï?
­n¥Îµ{¦¡¤U¥h¶]¶Ü
³Â·Ð¤j®a¤F

³øªí.rar (45.22 KB)

¦^´_ 13# joey0415

§A¦n §Ú«á¨Ó¥Î§A»¡ªº¤è¦¡§ï¼g
select
sum([¶}©l®É¶¡]) as ¶}©l®É¶¡  ,
sum([µ²§ô®É¶¡]) as µ²§ô®É¶¡ ,
sum([Á`¤u®É(¤À)]) as Á`¤u®É,
sum([¥ð®§®É¶¡])  as ¥ð®§®É¶¡
sum([À³§¹¦¨®É¶¡(¤À)]) as À³§¹¦¨®É¶¡,
sum([¤u®É®t]) as ¤u®É®t,
sum([²£­È]) as ²£­È ,
¤é´Á,¾Þ§@­û from [¨RÀ£¤é³øªí$]
group by ¤é´Á,¾Þ§@­û

¥i¬O¥ð®§®É¶¡·|¥X¿ù  «á¨Ó§Ú¥ý§â¥ð®§®É¶¡§R±¼


«á¨ÓÅܦ¨¶}©l»Pµ²§ô®É¶¡ ³£¸ò­ì¥»ªº¤£¦P  ¨ì¬O¨ä¥L­È³£¹ï?

TOP

¦^´_ 11# guaga


±N§Aªº¸ê®Æ²¤Æ¤@¤U¡A¦p¤U

³]©w¤@¤U§Aªº¤é´Á®æ¦¡§Y¥i

select sum([Á`¤u®É(¤À)]) as ®É¼Æ  , ¤é´Á,¾Þ§@­û  from [¤u§@ªí1$] group by ¤é´Á,¾Þ§@­û
   

TOP

¦^´_ 11# guaga


    SELECT ¾Þ§@­û, sum(²£­È) as Á`²£­È,sum(¤é´Á) as Á`®É¼Æ FROM [¨RÀ£¤é³øªí$] GROUP BY ¾Þ§@­û

as §â´N§â«e­±ªºªF¦è­«·s©R¦W

TOP

¦^´_ 10# joey0415

¯uªº«ÜÁÂÁ§A³o»ò¦³­@¤ßÀ°§Ú!!!

«á¨Ó§Ú¦³°Ñ¦Òºô¯¸¥Îgroup by
SELECT ¾Þ§@­û, sum(²£­È) FROM [¨RÀ£¤é³øªí$] GROUP BY ¾Þ§@­û  ³o­Ó¨S¦³°ÝÃD

¦ý¬O­n¼W¥[¤é´Á¤U¥h ­È´N¶]±¼¤F
SELECT ¾Þ§@­û, sum(²£­È),sum(¤é´Á) FROM [¨RÀ£¤é³øªí$] GROUP BY ¾Þ§@­û

ÁÙ¦³ Äæ¦ìªº¹w³]­È³£¬O³o¼Ë(¦p¹Ï)

TOP

¦^´_ 9# guaga


select sum([Á`¤u®É(¤À)]),sum([¥ð®§®É¶¡(¤À)]),sum([À³§¹¦¨®É¶¡(¤À)]),sum(¤u®É®t) from [¨RÀ£¤é³øªí$] where ¾Þ§@­û in ('¸¦©g','¦t©Ô')

¥i¥H°Ñ¦Ò¥H¤U
http://www.1keydata.com/tw/sql/sqlin.html

¦Ó²Ä¤E½g¦^¤åªº¤è¦¡¡A¥i¥H¦C¥X©Ò¦³¾Þ§@­ûªº¥[Á`¶µ

¦Ó§A°Ýªº«h¬O«ü©w¬Y¨Ç¤H­û

¦Ó in  ¤¤ªº¤H­û¡A¤]¥i¥H¬Oselcet¬d¸ß  ¡A¨Ò¦p§A§Q§ä¨ì¬YºØ±Æ¦Cªº«e¤T¦W»yªk«á¡A§â¥¦©ñ¶iin¤¤¡A¥¦¤]·|¦Û°Ê§ä¥X§A­nªº¶i¶¥¸ê®Æ

¨Ò¦p¤l¬d¸ß
http://www.1keydata.com/tw/sql/sql-subquery.html
°Ñ¦Ò

TOP

¦^´_ 8# guaga

¤£¦n·N«ä ¦b½Ð°Ý¤@¤U ¦pªG­n¼W¥[¾Þ§@¤H­û¬O ¦bwhere ¾Þ§@­û«á­±¦A¼W¥[¦WºÙ¶Ü
select sum([Á`¤u®É(¤À)]),sum([¥ð®§®É¶¡(¤À)]),sum([À³§¹¦¨®É¶¡(¤À)]),sum(¤u®É®t) from [¨RÀ£¤é³øªí$] where ¾Þ§@­û='¸¦©g,¦t©Ô'

TOP

¦^´_ 7# joey0415
¦Û¾Ç¥i¥H³o»ò¼F®`  §Ú­nÀË°QÀË°Q
¬O°Ñ¦Ò"excel»P¥~³¡¸ê®ÆµLÁ_¾ã¦X"³o¥»¾Çªº¶Ü

TOP

¥»©«³Ì«á¥Ñ joey0415 ©ó 2013-11-12 11:43 ½s¿è

¦^´_ 6# guaga

select   ­û¤u, sum(§A­n¥[Á`ªºÄæ¦ì¡A¨Ò¦p¤u®É) from §Aªºsheet   where §A­n¿ï¨úªº½d³ò(¦p«ü©w¤é´Á¡K)    group by §A­n¨C¤À²ÕªºÄæ¦ì(¨Ò¦p¡G­û¤u, ¤é´Á)


    Ãþ¦ü³o¼Ëªº»yªk¡A§A¤j·§¥i¥H§â©Ò¦³ªº¸ê®Æ¡A«ö·Ó¡A­û¤u»P¤é´Á¡A§â©Ò¦³¤u®É¥[Á`


¥H¤W¬°­Ó¤H¦Û¾Ç¥Î»y¤£¤@©wºë·Ç

group by´N¬O§â§A­nªº¸ê®Æ¤À¦¨¤@¸s¤@¸sªº¡A¤§«e¦b«ö·Ó§A­nselect±ø¥ó§PÂ_¡A¨Ò¦p§A­nsum¥[Á`¡A¥¦´N±N§A«ü©wªº¸s²Õ¥[Á`¡K


°Ñ¦Ò°Ñ¦Ò

TOP

¦^´_ 5# joey0415

§Ú¥Î¥X¨Ó¤FÁÂÁ§A
·Q½Ð°Ý¤@¤U §A»¡ªºgroup by  
¦³¿ìªk±N©Ò¦³¾Þ§@­û°µ¤@­Ó¥[Á`¶Ü
ÁÙ¬O­n¥ÎVBA¼¶¼g?

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD