Received: from shell.mpsi.net (shell.mpsi.net [207.252.220.24]) by hub.org (8.8.8/8.7.5) with ESMTP id LAA14738 for ; Mon, 1 Jun 1998 11:00:00 -0400 (EDT) Received: from localhost (alewis@localhost) by shell.mpsi.net (8.8.6/8.8.6.Beta3) with SMTP id OAA16776 for ; Mon, 1 Jun 1998 14:59:59 GMT Date: Mon, 1 Jun 1998 09:59:59 -0500 (CDT) From: Andy Lewis To: mailto: ; Subject: Complex table/query Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I have the following info to store in a DB: [1] Keep a record of category items as well as owner name, street, state, zip..etc .... [2] Keep a running tab on the number of items overall in the DB [3] Keep a running tab on the number of items overall in the DB by state. I am allowing the viewer to first select the state and then the city and finally the category. Once they arrive at the category page I want to show them the number of items that are in the DB for that state, city and category. I am using PHP/Postgres to make a statement that will show the categories, of which there are around 115. The obvious 50 states.... I can build this ridulious SQL statement that just eats the hell out of the processor. Does anyone have any ideas how I can query/build this thing? Thanks Andy