simple sql select help

Поиск
Список
Период
Сортировка
От kaf@ip146.usw5.rb1.bel.nwlink.com (Kyle)
Тема simple sql select help
Дата
Msg-id 83dtuc$1nh$1@ip146.usw5.rb1.bel.nwlink.com
обсуждение исходный текст
Список pgsql-sql
I'm fairly new to sql & postgres.  I need some help with this query on
a database I'm constructing.  I've got two tables, publishers & books,
which have the following columns (some columns removed for simplicity):
    publishers:name (primary key), address, ...
    books:title, publisher, ...

Given the above I'd like to query the database to see how many books
each publisher has.

The publisher column of the books table should be declared a foreign
key to publishers.name, though I haven't put the appropriate triggers
in yet.  Like I said, I've not much database experience.  Humor me
here, how do I find the number of books each publisher has?

Thanks,
Kyle
kaf@_nwlink_._com_
remove underscores to reply



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] select with group by problem
Следующее
От: "Mitch Vincent"
Дата:
Сообщение: Sub-select speed.