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

[µo°Ý] SQL¬d¸ß½Ð±Ð¡H

[µo°Ý] SQL¬d¸ß½Ð±Ð¡H

¤p§Ì¦³¤@­Ó¸ê®Æ®w¡A·Q±q¤¤§ä¨ì¥H¡ustockid¡v±Æ¦C¡A¨Ã¥B¦A¨ú¡u§Ç¸¹¡v³Ì¤j­Èªº»yªk¡H

¤p§Ì¥u·|¼g¦¨³o¼Ë¡H
select stockid,MAX(§Ç¸¹) from AAA group by stockid order by stockid¡A¤£ª¾¦³­þ¦ì°ª¤â¥i¥H«üÂI¤@¤U
ÁÂÁÂ

select aaa.* from aaa,
(select stockid, MAX(§Ç¸¹) as MAXA from AAA
group by stockid) bbb
where aaa.stockid = bbb.stockid
and aaa.§Ç¸¹ = bbb.maxa
order by aaa.stockid
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        ÀR«ä¦Û¦b : §Ú­Ì­n°µ¦nªÀ·|ªºÀô«O¡A¤]­n°µ¦n¤º¤ßªºÀô«O¡C
ªð¦^¦Cªí ¤W¤@¥DÃD