vendredi 10 avril 2015

Show id's that only contain one kind of name

Here is a table which will help me to explain the question a lot.



id | name
----|--------------
1 | John
1 | John
1 | Arya
2 | Tyrion
2 | Tyrion
3 | Jamie
3 | Cersie


I need to make a SQL query that only shows id 2 because it only contains one kind of name. 1 and 3 will not be shown because they have 2 different names. 1 would have been shown if Arya would have been John, because then 1 would only contain Johns.


Aucun commentaire:

Enregistrer un commentaire