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

sql²éѯÎÊÌâ - .NET¼¼Êõ / .NET Framework

±íTAÖÐ:
ID StudentID¡¡Lession Scroe
1 0201 Êýѧ 98
2 0201 ÓïÎÄ 68
3 0201 ÎïÀí 100
1 0202 Êýѧ 58
2 0202 ÓïÎÄ 67
3 0202 ÎïÀí 85
1 0203 Êýѧ 85
2 0203 ÓïÎÄ 94
3 0203 ÎïÀí 76

(1)ÓÃÒ»ÌõSQLʵÏÖ´Ó±íTAÖÐÈ¡³öÿÃſγÌÖеÄ×î¸ß·Ö
(2)ÓÃÒ»ÌõSQlʵÏÖ´Ó±íTAÖÐÈ¡³öûÃſγ̷ÖÊý×î¸ßµÄѧÉúµÄ£É£Ä£¨StudentID )
   




1¡¢SELECT Lession,MAX(Scroe) from TA GROUP BY Lession
2¡¢SELECT id,scroe,lession from TA ,(SELECT Lession,MAX(Scroe) as scroe from TA GROUP BY Lession) t1 WHERE TA.scroe = t1.scroe AND ta.lession = t1.lession

BTW£ºµ¥´Ê´íµÄҲ̫ÀëÆ×ÁË°É

²»ÊǺÜÄÑ°É
SELECT Lession,MAX(Scroe) from TA GROUP BY Lession

µÚÒ»ÎÊÓ㺰´Ìõ¼þ²éѯ£»
µÚ¶þÎÊÓ㺰´Ö÷²éѯ£»

¸÷λ¸ßÊÖ,ÇëÎÊÒ»ÏÂ,Ôõôɾ³ý±íÖеÄÖظ´¼Ç¼?

ÒýÓÃ
¸÷λ¸ßÊÖ,ÇëÎÊÒ»ÏÂ,Ôõôɾ³ý±íÖеÄÖظ´¼Ç¼?

ÊÇɾ³ýÖظ´µÄËùÓÐÊý¾Ý»¹ÊÇֻɾÁôÏÂÒ»Ìõ,±ÈÈçÓÐÁ½ÌõһģһÑùµÄÊÇÕâÁ½Ìõ¶¼É¾»¹ÊÇֻɾ³ýÆäÖÐÒ»Ìõ?

ÕâÁ½ÖÖÇé¿öÏ£Íû¶¼Ö¸µãÒ»ÏÂ,лÁË

//---ÔõÑù²éѯ³öÒ»¸ö±íÖÐij¸ö×Ö¶ÎÖظ´µÄÁÐ
select * from table where column in
 (select column from table group by column having count(*)>1) order by column;

ÄãÖ»ÒªÉèÖ÷ûºÏÖ÷¼ü,¾Í²»»áÓÐÖظ´¼Ç¼!!!

ÎÒҲѧϰѧϰ¡¢¡¢¡¢¡¢


ÓÑÇé°ï¶¥Ï£¡Ë³±


Ïà¹ØÎÊ´ð£º

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

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

Çë½ÌsqlÓï¾ä¡£ - Oracle / ¿ª·¢

ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
  ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......

sqlССµÄÒÉÎÊ - .NET¼¼Êõ / C#

¿ÉÄÜÒòΪ¹¤×÷µÄÔ­Òò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......

ASPÒ³ÃæÎÞ·¨´ò¿ªÇóÖú£¡ - MS-SQL Server / »ù´¡Àà

¸÷λºÃ£¬ÎÒ¸Õ°ÑÒ»¸öASPÍøÕ¾ÉèÖúÃÁË£¬Ò²ÄÜÕý³£·ÃÎÊ¡£µ«ÊÇÔÚÎÒ±¾»úÉϲ»ÄÜ´ò¿ªadmin\login.asp,ËùÒÔÎÞ·¨ÊµÏÖºǫ́¹ÜÀí¡££¨´íÎóÌáʾÎÞ·¨ÕÒµ½ÍøÒ³£¬´úÂë404£¬ÎҵIJÙ×÷ϵͳÊÇwin2000 server)
µ«ÊÇÆæ¹ÖµÄÊÇÔÚ¾ÖÓòÍøµÄÆäËû» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ