Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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;

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

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


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


Ïà¹ØÎÊ´ð£º

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

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

ÇóÒ»sqlÓï¾ä - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÏÖÔÚÓÐÁ½ÕÅ±í£ºÎÄÕÂÖ÷±íA(articleId,articleTitle)£¬ÎÄÕÂÆÀÂÛ±íB(commentId,articleId,commentTitle)
ÏÖÔÚÎÒÏëʵÏÖÕâÑùµÄ¹¦ÄÜ£ºÁгöÎÄÕÂÁÐ±í£¬ÆäÖÐÿƪÎÄÕ±êÌâÏÂÃæÁгö´ËÎÄÕµÄÇ°2¸öÎÄÕÂÆÀÂÛ£¬ÇëÎÊsqlÓï¾äÔõôд°¡ ......

MS SQL×÷ÒµÎÊÌâ - MS-SQL Server / Ó¦ÓÃʵÀý

ÈçºÎÔÚSQL2005ÖÐÉ趨¶¨Ê±×÷Òµ£¬±ÈÈç˵¶¨Ê±ÇåÀíijЩ±íµÄÊý¾Ý£¬
»òÕßÊǶ¨Ê±µÄ½«Ä³Ð©±íµÄÊý¾Ýµ¼³öexcel£¡
ÔÚÏߵȴý£¬¼±¼±¼±£¬×îºÃÊÇÏêϸ²½Ö裡
֮ǰÎÒ×öµÄ×÷ÒµÓеãÎÊÌ⣡
°ïUP

²Î¿¼:http://hi.baidu.com/toiota ......

sqlÓï¾äÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÏÖÔÚÓÐÒ»¸ö²¿Ãűídept£¨²¿ÃÅÃû³Æ£¬²¿Ãźš£¡££©ÓÐÒ»¸öÈËÔ±±íemp£¨ÐÕÃû£¬ÈËÔ±±àºÅ£¬Ö°Î»£¬Ð½×Ê£¬²¿ÃÅ£©
emp±íÖеÄÄÚÈÝÊÇÕâÑùµÄ£º
a 1 ¹¤³Ìʦ 3000 Èí¼þ²¿
b 2 ÆÕͨԱ¹¤ 2000 Ó²¼þ²¿
c 3 ¹¤³Ìʦ 4000 Ó²¼þ²¿
d ......

Accessͨ¹ýSqlÓï¾ä´´½¨Êý¾Ý¿â - .NET¼¼Êõ / C#

ÔÚAccessµÄ²éѯÖÐÖ´ÐÐÏÂÃæµÄÓï¾ä,ÎÞЧ,ÌáʾÆÚ´ýselect ,updata ,...
CreateTble C=Answer N="»ØÌû±í"
(
  C=ID T="INTEGER" P=No M=No N="±àºÅ" Z=false,
  C=Ques ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ