| От | Ragnar |
|---|---|
| Тема | Re: How would I write this query... |
| Дата | |
| Msg-id | 1146500531.11473.3.camel@localhost.localdomain обсуждение исходный текст |
| Ответ на | How would I write this query... ("Jim Fitzgerald" <jfitz@spacelink.com>) |
| Список | pgsql-general |
On sun, 2006-04-30 at 11:32 -0700, Jim Fitzgerald wrote:
> I have two tables, one of them has names of people and an associated
> integer ID. The other table is a list of the people (from the first table)
> by their ID number that have signed up for a class. How would I write a
> query that would list all the people from the first table that do not have
> any entries in the second table? Basically, I want a listing of all my
> people who have not signed up for the class.
try
SELECT * FROM people LEFT JOIN classes using (peopleid)
WHERE classes.classid IS NULL;
gnari
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера