标签:join 查询 http mic 结构 src 图片 height nbsp
s
1,表结构:city_info
2,实体类
3,sql:
方法一:关联查询
select ci1.id,(select ci2.name from city_info ci2 where ci2.id = ci1.pId) as pName,ci1.name,ci1.title,ci1.type from city_info ci1;
方法二:左外连接查询
select ci1.id,ci2.name pName,ci1.name,ci1.title,ci1.type from city_info ci1 LEFT JOIN city_info ci2 ON ci1.pId = ci2.id;
4,查询结果
标签:join 查询 http mic 结构 src 图片 height nbsp
原文地址:https://www.cnblogs.com/zuok9527/p/12028138.html