oracle - SQL Select exact matches to multiple items with duplicate ID's -


i trying select speaks exact same languages (french, italian, , russian) table. should return maja:

person     lang      ---------- ---------- ann        english    ann        japanese   bill       english    bill       japanese   bill       russian    chris      english    chris      russian    david      english    david      japanese   david      russian    ernie      english    ernie      french     ernie      japanese   fumie      japanese   fumie      korean     maja       french     maja       italian    maja       russian    

the code have understandably doesn't work since names duplicated , query returns 0 results:

select  distinct person speaks lang = 'french' , lang = 'russian' , lang = 'italian'; 

any appreciated cannot figure out how deal these duplicate names.

try this:

select person speaks lang in( 'french', 'russian', 'italian') group person having count(distinct lang) = 3 

the distinct inside count needed in case can have duplicates, i.e. same language related person more 1 time.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -