¡¡¡¡Í¨³£Ñ¡ÔñÖØ¸´¼Ç¼£¬¶¼ÐèÒªÓõ½DISTINCT£¬µ«Óиö²»ºÃµÄµØ·½£¬¾ÍÊDz»ÄÜÑ¡Ôñ¶à¸ö×ֶΣ¬ÉÏÍøÕÒÁËÁ¼¾Ã£¬ÔÚ¶¯Íø·¢ÏÖÒ»¸öÌù½â¾öÕâ¸öÎÊÌ⣬ÀûÓõÄÏÂÃæµÄÓï¾ä£º sql="select a,b from tab where id in (select min(id) from tab group by a)" ¡¡¡¡¹ØÓÚSqlµÄDistinct·ÀÖ¹¼ÇÂ¼ÖØ¸´Óï¾äµÄÒÉ»ó ¡¡¡¡ÒÔǰºÜÉÙÓÃ,µ«ÏÖÔÚÓиöÏîĿҪÇóÈ¡³öµÄ¼Ç¼ûÓÐÖØ¸´µÄ rs.open "select Distinct »áÔ± from ±í1 where Ö÷Ìâ=false and ¾Ñé>200 order by »áÔ± desc",link1,1,1 ¡¡¡¡ÒÔÉÏSQLÓï¾ä¿ÉÒÔÈ¡³öÊý¾Ý¿âÖзûºÏÌõ¼þµÄ»áÔ±(¶øÇÒ¿ÉÒÔʵÏÖûÓз´»ØÖظ´¼Ç¼),µ«Èç¹û¸Ä³ÉÒÔÏÂÈýÖÖÇé¿ö,¾Í»á³öÏÖµ÷²»³ö¼Ç¼»òµ÷³öµÄ¼Ç¼ÓÐÖØ¸´»òÕßµ÷³öµÄ¼Ç¼Òì³£,ÇëÎÊÕâÊÇΪʲô?ÄѵÀDistinctÒ»´ÎÖ¸¶¨É¸Ñ¡Ò»¸ö×Ö¶Î? rs.open "select Distinct * from ±í1 where Ö÷Ìâ=false and ¾Ñé>200 order by »áÔ± desc",link1,1,1 rs.open "select Distinct »áÔ±,×¢²áÈÕÆÚ from ±í1 where Ö÷Ìâ=false and ¾Ñé>200 order by »áÔ±,×¢²áÈÕÆÚ desc",link1,1,1 rs.open "select Distinct »áÔ±,×¢²áÈÕÆÚ from ±í1 where Ö÷Ìâ=false and ¾Ñé>200 order by »áÔ± desc",link1,1,1
|