SELECT t2.province_name 省, t2.city_name 市, t2.district_name 区, t2.county_name "乡/县/街道" FROM ( SELECT r.id province_code, r.name province_name, r1.name city_name, r2.name district_name, r3.name county_name FROM region r LEFT JOIN region r1 ON r.id = r1.pid AND r1.deep = 1 LEFT JOIN region r2 ON r1.id = r2.pid AND r2.deep = 2 LEFT JOIN region r3 ON r2.id = r3.pid AND r3.deep = 3 WHERE r.deep = 0 ) t2 WHERE ( INSTR ( '亚运村街道', t2.province_name ) OR INSTR ( '亚运村街道', t2.city_name ) OR INSTR ('亚运村街道', t2.district_name) OR INSTR ('亚运村街道', t2.county_name) ) AND INSTR ( '亚运村街道', t2.county_name)
|