SELECT U.id,u.User_name,U.user_sex,(t.CIty_Name+c.CIty_name) AS City FROM [USER] AS U LEFT JOIN City AS C ON u.city_ID=c.ID LEFT JOIN City AS t ON c.Parent_ID=t.ID WHERE t.Parent_ID=0
lissome
2017-05-23 15:28:38 +08:00
``` select u.id, u.user_name, u.user_sex, CONCAT(p.city_name, c.city_name) as city from `User` u left join City c ON c.id = u.city_id left join City p on p.id = c.parent_id ```