aggregate question

From: "Ryan" <pgsql-sql(at)seahat(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: aggregate question
Date: 2003-06-23 18:59:52
Message-ID: 54717.65.102.128.233.1056394792.squirrel@fordparts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I know this one is simple enough.

I have two tables: packages and package_log.

paulsonsoft=# \d packages
Table "public.packages"
Column | Type | Modifiers
-----------------+---------+------------------------------------------------------------------
package_name | text | not null
package_desc | text | not null
package_ver | text | not null
package_date | text | not null
package_loc | text | not null
package_type | text | not null
package_creator | text |
package_status | boolean | default true
package_id | integer | not null default
nextval('public.packages_package_id_seq'::text)
Indexes: packages_pkey primary key btree (package_id)
Foreign Key constraints: $1 FOREIGN KEY (package_type) REFERENCES
package_types(package_type) ON UPDATE CASCADE ON DELETE RESTRICT

paulsonsoft=# \d package_log
Table "public.package_log"
Column | Type | Modifiers
-------------+---------+-----------------------------------------------------------------
custno | text | not null
package_id | text |
timestamp | text | not null
ip_address | text | not null
completed | boolean |
current_ver | text |
logo | text |
licenses | text |
log_id | integer | not null default
nextval('public.package_log_log_id_seq'::text)
Foreign Key constraints: $1 FOREIGN KEY (package_id) REFERENCES
packages(package_id) ON UPDATE CASCADE ON DELETE RESTRICT

I must be a total space case today because I can't hammer out the sql to
get a listing of all the packages with a count() of the package_log by
package_id.

Thanks,
Ryan

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Bertheau 2003-06-23 19:08:37 Re: multi-table unique index
Previous Message Michael A Nachbaur 2003-06-23 18:34:11 Re: multi-table unique index