我写了一个语句:
select d_name as '区县',乡镇,普查区,普查小区 from dress,
(select d_name as '乡镇',普查区,普查小区,d_pid as pid from dress,
(select num as '普查小区',d_name as '普查区',d_pid as pid
from pcxq,dress
where pcxq.code=dress.d_code) as pcq
where dress.d_id=pcq.pid) as xz
where dress.d_id=xz.pid
感觉可能复杂了,求高手指点。
九州编程
相关分类