Answer the question
In order to leave comments, you need to log in
Selecting unique records by two fields?
There is a message board
|кто |кому |text |
|паша|маша |text |
|маша|паша |text |
|коля|маша |text |
|паша|сережа|text |
|юра |паша |text |
|паша|света |text |
Answer the question
In order to leave comments, you need to log in
SELECT name
FROM
(
SELECT Кто AS name
FROM Table
WHERE Кому='Паша'
UNION
SELECT Кому
FROM Table
WHERE Кто='Паша'
) AS t1
GROUP BY name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question