| От | Owen Funkhouser |
|---|---|
| Тема | Difficult select statement |
| Дата | |
| Msg-id | 3F72339F.DF4C256C@highwaay.net обсуждение исходный текст |
| Ответы |
Re: Difficult select statement
|
| Список | pgsql-novice |
I have two tables. Table "data" has three fields, "id integer", "project text", and "component text". Table "participants" has two fields, "id integer" and "username text". The id in each table correspond to the same thing. The values for each table is as follows: data ---- 1 | Stocks | Decisions 2 | Stocks | Loss 3 | Stocks | Profits 4 | Bonds | Interest participants ------------ 1 | George 1 | Harry 1 | Carmen 2 | Owen 2 | John 3 | Harry 4 | Bubba What I want is a distinct list of id, project, and component where username = Harry. Resulting in the following: 1 | Stocks | Decisions 3 | Stocks | Profits Can this be done in a single SQL statement?
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера