我正在使用内部连接,并且我希望从这两个表格中获得不同的值,并且在我的查询中我正在从这两个表格中选择列。 像使用连接时从2个表格中需要的不同的值
select countryid,countryname,city from country
inner join city
on country.id=city.id
我可以用不同的像
select distinct t.countryid from (select countryid,countryname,city from country
inner join city
on country.id=city.id) as t
,但我不能够使用城市这样
我想是选择不同的国家,城市
该怎么做
'select countryname,city from country inner join city on country.id = city.id'? –
@FelixPamittan你究竟是什么意思? –
上面的查询是否给出了正确的结果? –