From: Ryan <pgsql-sql@seahat.com>
To: pgsql-sql@postgresql.org
Subject: aggregate question
Date: Mon, 23 Jun 2003 13:59:52 -0500 (CDT)
Message-ID: <54717.65.102.128.233.1056394792.squirrel@fordparts.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pgsql-sql@seahat.com
Subject: Re: aggregate question
In-Reply-To: <54717.65.102.128.233.1056394792.squirrel@fordparts.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox