help with subquery! returns more than 1 row

前端 未结 3 1080
慢半拍i
慢半拍i 2021-01-28 06:53

i dont understand the problem with returning multiple rows:

here is my table BBC:

name    region  area    population  gdp
Afghanistan South Asia  652225          


        
3条回答
  •  情书的邮戳
    2021-01-28 07:28

    This is because you are trying to compare region to a table of values. Instead, try using in:

    select name 
    from bbc 
    where region in 
        (select region from bbc where name='India' or name='Iran')
    

提交回复
热议问题