Which date/paper pairs are NOT represented?

Поиск
Список
Период
Сортировка
От Andrew Perrin
Тема Which date/paper pairs are NOT represented?
Дата
Msg-id Pine.LNX.4.21L1.0201051532250.600-100000@nujoma.perrins
обсуждение исходный текст
Ответы Re: Which date/paper pairs are NOT represented?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
Okay, y'all have been very helpful so far so here's another difficult
query.

This is the same database I've asked about before:

papers: information about newspapers, including a unique paperid
letters: information and text of letters to the editor, including the
paperid

There are, as you might expect, numerous letters on a given date in a
given paper. What I need to know, though, is for what paper/date pairs in
my sample I do NOT have any letters (since this probably represents a
data-collection glitch).  I know I can do:

SELECT paper, date, count(date)  FROM papers, letters WHERE
papers.papercode = letters.papercode GROUP BY paper, date; 

but adding a HAVING count(date) < 1 seems to return 0 rows.

Thanks-
ap

----------------------------------------------------------------------
Andrew J Perrin - andrew_perrin@unc.edu - http://www.unc.edu/~aperrinAssistant Professor of Sociology, U of North
Carolina,Chapel Hill     269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA
 




В списке pgsql-sql по дате отправления:

Предыдущее
От: Bill Cunningham
Дата:
Сообщение: Re: Telling how many records are joined
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: simple? join