你这个关键在于,
id在A表是否可能重复? ---假设是不能重复的
pid在B表是否可能重复? ---假设是能重复的,pid,class联合起来是不重复的
tid在C表是否可能重复? ---假设是能重复的,tid,group联合起来是不重复的
select a.id,a.name,a.grade,bb.class,cc.group
from a,
(select pid,max(class) class from b group by pid) bb,
(select tid,max(group) group from c group by tid) cc
where a.id = bb.pid and a.id = cc.tid
and A.id between 10 and 20
select id,name,grade,class,group from A a,B b,C c where a.id between 10 and 20 and a.id = b.pid and a.id = c.tid;
select distinct id,name,grade,class,group from A,B,C where id=pid and id=tid and id>=10 and id<=20