2 Table Select - Mailing list pgsql-sql

From Andy Lewis
Subject 2 Table Select
Date
Msg-id Pine.LNX.4.05.9905271105190.22984-100000@tmg.themecca.net
Whole thread
Responses Re: [SQL] 2 Table Select
List pgsql-sql
I am trying to get the _total_ number of jobs
that each company has in the db.

In other words I want to get each distinct company
that has jobs in the jobs table and the _total_ number 
of jobs that it has in the jobs table.

What would be the best query that I could use?

I'm using 6.4.2.

Table = jobs
+-------------+---------------+-------+
| Field       | Type          | Length|
+-------------+---------------+-------+
| job_id      | int4 not null |     4 |
| company_id  | int4          |     4 |
| title       | varchar()     |    50 |
...
+-------------+---------------+-------+

Table = company
+--------------+---------------+-------+
|Field         |Type           | Length|
+--------------+---------------+-------+
| company_id   | int4 not null |     4 |
| company_name | varchar()     |   100 |
| email        | varchar()     |   100 |
...
+--------------+---------------+-------+

Thanks

Andy



pgsql-sql by date:

Previous
From: JT Kirkpatrick
Date:
Subject: RE: [SQL] select nextval. . .
Next
From: Tom Lane
Date:
Subject: Re: [SQL] notifying