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

Sql²éѯÓï¾äÎÊÌâ - .NET¼¼Êõ / ASP.NET

±ít1
3¸ö×Ö¶ÎCompanyName Product EntryDate
°´ÕÕʱ¼äÅÅÐòÏÔʾǰ10ÌõÊý¾Ý¡£
µ«ÊÇ£¬Ã¿Ò»¼Ó¹«Ë¾ËùÏÔʾµÄ²úÆ·¼Ç¼²»Äܳ¬¹ý2Ìõ¡£
Ò²¾ÍÊÇ˵£¬ÓпÉÄÜÇ°Ãæ10ÌõÊý¾Ý¶¼ÊÇͬһ¼Ò¹«Ë¾µÄ¡£ÄDz»ÐУ¬±ØÐëÒ»¼Ó¹«Ë¾¡£×î¶àÖ»ÄÜ2Ìõ¡£

ÕâÊÇÎÒÃæÊÔÅöµ½µÄÒ»¸öÎÊÌâ¡£¿àÏëÁ˺ܾã¬Ò²Î´ÄÜÍ»ÆÆ¡£»¹Çë¸ßÊÖÃÇÖ¸½Ì¡£Ð»Ð»£¡

 
Çó¸ßÊÖ£¬×Ô¼º¶¥

Ò²¾ÍÊÇ˵ֻÏÔʾ5¼Ò¹«Ë¾ £¿ ¶øÇÒÊÇ5¼Ò¹«Ë¾ÀïµÄÐÅÏ¢×î¿¿Ç°µÄ2ÌõÊý¾Ý £¿£¿

Èç¹ûÊÇsql server 2005ÒÔÉÏ£¬¿ÉÒÔÓÃrank():
select top 10 t.CompanyName, t.Product, t.EntryDate
 from (select CompanyName, Product, EntryDate , rank() as rank over (partition by CompanyName order by entrydate) from t1 order by entrydate) t where t.rank <= 2

ÓеãÄѶÈ~~~

select * from Tb a where CompanyName in (select top 2 CompanyName from Tb where id=a.id order by CompanyName)


ÓеãÂé·³!

Èç¹ûÊÇsql server 2000,ÊÔÊÔÕâ¸ö£º

select top 10 a.* from t1 a where (select count(*) from t1 b where a.CompanyName = b.CompanyName and a.EntryDate < b.EntryDate) <= 2

¸Äһϣº
select top 10 a.* from t1 a where (select count(*) from t1 b where a.CompanyName = b.CompanyName and a.EntryDate < b.EntryDate) <= 2 order by a.entrydate


ºÏÔÚÒ»Æð£º

sql server 2005ÒÔÉÏ£º
SQL code:

select top 10 t.CompanyName, t.Product, t.EntryDate
from (selec


Ïà¹ØÎÊ´ð£º

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

asp.netµ¼³öEXCELÎÊÌ⣡ - .NET¼¼Êõ / ASP.NET

C# code:

SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......

asp.net³ÌÐòÔ±ÇóÖ° - .NET¼¼Êõ / ·Ç¼¼ÊõÇø

±¾È˹¤×÷¾­ÑéÒ»ÄêÒÔÉÏ
ÊìϤasp.net
ÊìϤjavascript
ÊìϤCss
ÊìϤajax
ÊìϤsqlserver2005
ÓÐÒ»ÄêµÄÏîÄ¿¾­Ñé
¾ßÌåÏîÄ¿ºÍÆäËûµÄ¾Í²»ÔÚÕâдÁË
ÓÐÒâÕßÁªÏµ£º
QQ:359233910
ÒýÓÃ
±¾È˹¤×÷¾­ÑéÒ»ÄêÒÔÉÏ
ÊìϤasp ......

SQL·ÖÒ³ÓëOracle·ÖÒ³µÄÒÉÎÊ£¿ - Java / Web ¿ª·¢

ÕâÀïÏëÁ˽âÏ£¬¹ØÓÚSQL ServerÖзÖÒ³ºÍOracleÖзÖÒ³£»
ƽ³£Ð´Ó¦ÓóÌÐòµÄʱºò£¬±ÈÈçÓõÄÓïÑÔÊÇJava£¬ÓиöÁбíÒ³Ã棬ÐèÒª¶ÔÊý¾Ý·ÖÒ³ÏÔʾ£»
ÕâÀïÒª·ÖÒ³ÄѵÀ²»ÐèÒª½èÖúJava£¬¶øÖ±½ÓsqlÄÜÖªµÀ·ÖÒ³Âð£¬ÆðÂëÒ²Òª´«¸öÒ³Âë½ ......

¹ØÓÚSqlµÄÎÊÌâ - .NET¼¼Êõ / ASP.NET

½«Ò»¸ö²éѯÓï¾ä¸³¸øÒ»¸ö±äÁ¿£¬ÈçÏ£º
DECLARE @STR NVARCHAR(MAX)
SET @STR='SELECT * from SALE_PROD'
ÔõôÑù²ÅÄÜÖ´ÐÐËüÄØ£¿
Çë¸ßÊÖ£¬ÈÊÐÖ£¬ÏÀ½ã°ï°ïæ°¡


¶àл£¬¿ÉÒÔÀ²£¬¸ßÊÖ°¡

Ö±½ÓÖ´ÐоÍÐÐÁË

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