[已解决]关于多表查询的一个问题
本帖最后由 cengun 于 2012-04-17 11:02 编辑select tr.itemid,ti.type,ti.item,tm.college,tm.major,tr.class,tr.sname,tr.pid,tr.sid,tr.ssex,tr.addtime from (select b.sortid,b.parentid,a.sortname as type,b.sortname as item from aspcms_itemsort a,aspcms_itemsort b where a.sortid=b.parentid) ti,(select d.sortid,d.parentid,c.sortname as college,d.sortname as major from aspcms_majorsort c,aspcms_majorsort d where c.sortid=d.parentid) tm,aspcms_register tr where ti.sortid=tr.sortid and tm.sortid=tr.majorid;
关于数据库多表查询,感觉很麻烦,希望高手帮忙。
现有3个表:
A表:Aspcms_ItemSort
B表:Aspcms_MajorSort
C表:Aspcms_Register
现在想获得如下表所示信息,查询该如何做?请不吝赐教,谢谢!!!
页:
[1]