SQL Óï¾ä¡£¡£ Çë½Ì¸ßÊÖ
ÏÈÀ´Ò»¸ö´íÎóÓï¾ä¡£¡£
select * from [aa] where a1 in (select max(a2),a1 from [aa] group by a1 )
ÎÒ´óÌåÒâ˼£¬
¶Áȡһ¸öͳ¼ÆÏµÍ³ÖÐ ²»Öظ´µÄ IP °´ÕÕ ×îºóʱ¼äÅÅÐò£¬²¢ÏÔʾ³öËùÓÐ×ֶΡ£¡£
¸ßÊÖÇë°ï°ï棬£¬ÒªÇóÒ»ÐÐÓï¾äÍê³É¡£¡£
SQL code:
select *
from [aa] t
where not exists(select 1 from [aa] where a1=t.a1 and a2>t.a2)
SQL code:
select * from [aa] a where a2 = (select max(a2) from [aa] where a1=a.a1 )
ÈýÂ¥Õý½â¡£¡£¡£
ÏÂÃæÓï¾äµ÷ÊÔͨ¹ý£º
select * from [aa] where a2 in (select max(a2) from [aa] group by a1)
²éѯ³ö ²»Öظ´µÄa1 °´ÕÕ a2 ×î´óÖµ×ÔÓÉ ASC »ò DESC
·Ç³£¸ÐлÁ½Î»¸ßÊÖÖ¸µã¡£¡£
ллл¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
Ïà¹ØÎÊ´ð£º
±íÖÐÊÇÕâÑù£¬
²¿ÃźŠ²¿ÃÅÐÅÏ¢
1 ²¿ÃÅÒ»
2 ²¿ÃŶþ
3 ²¿ÃÅÈý
4& ......
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
'Select * into mytable from OpenDataSource(''Microsoft.JET.OLEDB.4.0'',''Data Source=f:\test.xls;Mode=Read;Extended Properties=Excel 5.0;Persist Security Info=False' ......
³ÌÐòʱASP+access
sql="select top 2 id,username from comp order by rnd(id) "
ÉÏÃæÓï¾äˢкó¶¼ÊÇÒ»¸öÖµ ÕâÑù»¹ÓÐËæ»úµÄÒâÒåÂð
ACCESSÓÐË¢ÐÂËæ»úÑ¡ÔñµÄSQLÓ ......