¾µä×Ó²éѯӦÓÃ
ÇóÖú£¬Ò»¸öACCESSµÄ²éѯÎÊÌâ¡«¡«ÓÐ3¸ö±í£ºstudent(ÄÚº¬sno£¬Ñ§ÉúѧºÅ£¬sname£¬Ñ§ÉúÐÕÃû£¬sageѧÉúÄêÁ䣬ssex£¬Ñ§ÉúÐÔ±ð)£¬sc±í£¨sno£¬Ñ§ÉúѧºÅ£¬cno£¬Ñ¡Ð޿κţ¬grade£¬³É¼¨£¬£©£¬course±í£¨cno£¬Ñ§Ð޿κţ¬ÒÔ¼°ÆäËüÐÅÏ¢£© ÏÖÔÚÓÃSQLÓï¾ä×öÒ»¸ö²éѯ£º²éѯËùÓгɼ¨ÎªÓÅÐ㣨´óÓÚ90·Ö£©µÄѧÉúµÄÐÕÃû ¼´¸ÃѧÉúÓÐÒ»ÃÅÑ¡Ð޿εÍÓÚ90·Ö±ã²»ÐÐ ÎÒÊÔÁ˺öà´Î£¬¶¼²»³É¹¦¡£ Çó½ÌÕâ¸ö²éÕÒµÄ˼·ºÍ½â·¨£¬Ð»Ð»ÁË£¡ ûÑÀÍÃÍ㺠ºÇºÇ,ÕâÖÖÎұȽÏÓÐÐËȤ,Ôõô¸Ð¾õÕâ¸öÀý×ÓºÍ ÉϿξٵÄÊÇÒ»ÃþÒ»ÑùµÄŶ ÄѵÀÄ㻹ÊÇѧÉú°¡? ˼·:ÏȲé³ö³É¼¨±íÖÐËùÓв»Âú×ãÌõ¼þµÄѧºÅ È»ºóÔÚѧÉú±íÖÐÅųýÕâЩѧºÅ,ËùÓÐÓÅÐãѧÉú¾Í³öÀ´À² select * from student where student.sno not in (SELECT distinct sc.sno FROM sc WHERE (((sc.³É¼¨)<="90"))) ÎûÎû,»¹ÓÐÒ»ÖÖ˼· ʹÓÃgroup,ÕÒ³öËùÓÐѧÉú×îС³É¼¨ È»ºóÔÙÅжÏ×îС³É¼¨ÊDz»ÊÇ>90 select * from (SELECT sc.sno, Min(sc.³É¼¨) AS ³É¼¨Ö®Min, student.ÐÕÃû FROM sc RIGHT JOIN student ON sc.sno = student.sno GROUP BY sc.sno, student.ÐÕÃû) where ³É¼¨Ö®Min>'90'
--------------------------------------------------------------------------------
Ïà¹ØÎÄÕÂ
MS Jet SQL for Access 2000Öм¶Æª (III) 2003-10-17 18:51:47
|