基本的字段查询问题,求高手相助
sql吧
全部回复
仅看楼主
level 1
koutianjiuwen 楼主
找出所有首都和国家名字,首都名要包含在国家名字中
2018年07月26日 15点07分 1
level 1
select a.*,b.*
from 国家 a
left join 首都b
on a.首都ID=b.id
where b.name like '%+a.name+%'
2018年07月27日 04点07分 2
好像我没把问题说清楚,我在楼下在重新描述下
2018年07月27日 10点07分
level 1
koutianjiuwen 楼主
在一张名叫world的表中,找首都名字包含国家名的,结果如图
2018年07月27日 10点07分 3
level 12
select * from world
where capital like '%' +[name]+'%'
2018年07月28日 08点07分 4
1