我现在的问题是取不出没有县级城市的市 ( select c.dc_province_city_d_id p1, c.pc_name n1, b.dc_province_city_d_id p2, b.pc_name n2 from dc_province_city_d a left join dc_province_city_d b on a.parent_id=b.dc_province_city_d_id left join dc_province_city_d c on b.parent_id=c.dc_province_city_d_id where c.parent_id=0 and b.dc_province_city_d_id='${D5}' ) union all (select c.dc_province_city_d_id p1, c.pc_name n1, a.dc_province_city_d_id p2, a.pc_name n2 from dc_province_city_d a left join dc_province_city_d b on a.parent_id=b.dc_province_city_d_id left join dc_province_city_d c on b.parent_id=c.dc_province_city_d_id where c.parent_id=0 and c.dc_province_city_d_id='${D5}' )
最终p1为省id,n1为省名称 p2为市和县id,n2为市和县名称 |