Files
ITMO/DB/DBLab2/task7.sql
T

8 lines
354 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SELECT ФАМИЛИЯ, ИМЯ, ОТЧЕСТВО, ДАТА_РОЖДЕНИЯ FROM Н_ЛЮДИ
JOIN (
SELECT ФАМИЛИЯ ФАМ, ДАТА_РОЖДЕНИЯ ДАТА, COUNT(ДАТА_РОЖДЕНИЯ) FROM Н_ЛЮДИ
GROUP BY ФАМ, ДАТА
) ON ФАМ = ФАМИЛИЯ AND ДАТА = ДАТА_РОЖДЕНИЯ
WHERE count = 1
ORDER BY ФАМИЛИЯ;