Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Çósql Óï¾ä - .NET¼¼Êõ / ASP.NET

id bh value time
K0011 01 25 2010-05-10 05:08:10
K0012 01 35 2010-05-10 05:10:10
K0013 01 35 2010-05-10 05:11:10
K0014 02 20 2010-05-10 05:08:11
K0015 02 50 2010-05-10 05:09:12
K0016 03 30 2010-05-10 05:08:10
K0017 03 25 2010-05-10 05:10:10
K0018 03 35 2010-05-10 05:10:10
K0019 01 35 2010-05-10 06:11:10
K0020 02 20 2010-05-10 06:12:10
K0021 02 40 2010-05-10 06:13:10
K0022 03 30 2010-05-10 06:14:10

ËùÓеÄ
id bh value time
K0019 01 35 2010-05-10 06:11:10
K0015 02 50 2010-05-10 05:09:12
K0018 03 35 2010-05-10 05:10:10

Éú³ÉËùÓбàºÅ×î´óÖµ£¬Èç¹ûÅöµ½×î´óÖµÓÐÏàͬµÄÔòȡʱ¼ä×î´óµÄÄǸö¡£
;wit tb as
(
  select xuhao = row_number() over (partition by bh order by value desc,time desc),
  id,bh,value,time
  from table
)

select id,bh,value,time
from tb
where xuhao=1

ÒýÓÃ
;wit tb as
(
select xuhao = row_number() over (partition by bh order by value desc,time desc),
id,bh,value,time
from table
)

select id,bh,value,time
from tb
where xuhao=1


Õý½â£¬Õë¶Ôsql2005ÒÔÉÏ°æ±¾

C# code



Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHig


Ïà¹ØÎÊ´ð£º

Asp+sql serverÎÊÌâ - Web ¿ª·¢ / ASP

ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º ......

ÇóÒ»SQL - MS-SQL Server / »ù´¡Àà

tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......

asp.netÈçºÎÌá¸ß·ÃÎÊËÙ¶È - .NET¼¼Êõ / ASP.NET

ÎÒ×î½ü×öÁËÒ»¸öÍøÕ¾ÊǹØÓÚ²úƷչʾµÄ ~ Õû¸öÍøվͼƬ¶¼Õ¼ÓÃÁËÒ»´ó°ë  
ÕâÑùµÄ»°·ÃÎÊËٶȾͷdz£Âý ÓÐʲô°ì·¨¿ÉÒÔ½â¾öÂð£¿
Âé·³´ó¼Ò¶à¶à¸øµãÒâ¼û £¡ ÓÐʲô¾¡¹Ü˵ 
3Q´ó¼Ò
htmlÒ³Ãæ.

Õâ¸ö,¼ÈÈ»Ö÷Ò ......

asp.net ¶þ²æÊ÷ treeview - .NET¼¼Êõ / ASP.NET

O O O O O O
  |.......| |........| |.......|
  | | |
  O O ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ