日期:2014-05-17 浏览次数:20456 次
SELECT t1.tongji FROM tab1 t1 LEFT JOIN tab1 t2 ON t1.AID=t2.FAID WHERE t2.AID=3
------解决方案--------------------
查询湖北的tongji字段:
SELECT tongji FROM Tab1 WHERE AREA='湖北'
查询aid是3的父栏的tongji字段
SELECT tongji FROM Tab1 WHERE aid IN (SELECT faid FROM Tab1 WHERE aid=3)