http://topic.csdn.net/u/20091231/16/2f268740-391e-40f2-a15e-f243b2c925ab.html [Õ÷¼¯]·Ö×éÈ¡×î´óNÌõ¼Ç¼·½·¨Õ÷¼¯ Èç¹û×îºóvalue¸Ä³Éʱ¼äµÄ»°£¬Çó×îÐÂʱ¼äµÄǰ2Ìõ select * from t_xinlan1022 a where 2>(select count(*) from t_xinlan1022 where eid=a.eid and cid=a.cid and time <a.time);
Çó³öÀ´µÄ²»¶ÔŶ£¬Çó¸ßÊÖÖ¸µã ÄãµÄ time ÊÇʲô×ֶΣ¬¾Ù¸ö²»¶ÔµÄÀý×ÓÌù³öÀ´·ÖÎöһϡ£ dateÀàÐ굀 date ÀàÐÍÓ¦¸ÃûÓÐÎÊÌâ°¡¡£
bas_car ±í ÓÐÁÐcarname £¬Òª½øÐÐÊý¾Ýͳ¼Æ£¬ select count(a.carname),a.carname from bas_car a,bas_car b where a.carid>=b.carid and a.carname=b.carname group by a.carname ÈçÉϲéѯ½á ......