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



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to