select classid,info from (select classid,min(info) as info from t2 group by classid) a inner join (select classid,max(info) as info from t2 group by classid) b on a.classid=b.classid and a.info<>b.info
调试欢乐多
select classid,info from t2 where classid=A order by ID union ... limit 2不过要知道T1的所有值现在想想SQL是否有while(...)语句??
您能把完整的SQL写下吗?另外:这种情况是不是mysql4.0无法完成的?
我用的是MYSQL4。0以上的,我的本地机就成,但公司的服务器就不成