ËùÓÐµÄ 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
Õý½â£¬Õë¶Ôsql2005ÒÔÉÏ°æ±¾ C# code
Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHig