Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0IEpp060299 for ; Thu, 18 Jan 2001 09:51:51 -0500 (EST) (envelope-from pgsql-general-owner@postgresql.org) Received: from mta3-rme.xtra.co.nz (mta3-rme.xtra.co.nz [203.96.92.13]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0GNdq038991; Tue, 16 Jan 2001 18:39:56 -0500 (EST) (envelope-from csawtell@xtra.co.nz) Received: from berty ([210.54.106.61]) by mta3-rme.xtra.co.nz with SMTP id <20010116233948.MCME11151673.mta3-rme.xtra.co.nz@berty>; Wed, 17 Jan 2001 12:39:48 +1300 Content-Type: text/plain; charset="iso-8859-1" From: Christopher Sawtell Organization: At Home To: "Diehl, Jeffrey" , pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] Query from multiple tables... Date: Wed, 17 Jan 2001 11:41:51 +1300 X-Mailer: KMail [version 1.2] Cc: "Diehl, Jeffrey" References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01011711415100.09521@berty> Content-Transfer-Encoding: 8bit X-Archive-Number: 200101/830 X-Sequence-Number: 3034 On Wed, 17 Jan 2001 09:46, Diehl, Jeffrey wrote: > Hi all, > > I have a database, that because of the size of the data, I have separated > on day's worth of data into it's own table. postgreSQL will manage absolutely huge tables without problems. ( 2GB, & 4GB with that file size setting in the kernel ) Why do you have to cut the data into smaller tables? > I have a separate table for > each of, say, 30 days. I would like to write a query that will query the > last 15 days worth of tables. Can this be done? No problem, if you leave the data in one table. > I tried to use a view; that didn't work. I tried to use the union clause; > that didn't allow me to do group by... > > Is there a better way than to have my program rewrite the sql on the fly? you can issue queries direct from the shell script which would allow you to use shell variables to hold the date datum. -- Sincerely etc., NAME Christopher Sawtell CELL PHONE 021 257 4451 ICQ UIN 45863470 EMAIL csawtell @ xtra . co . nz CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz -->> Please refrain from using HTML or WORD attachments in e-mails to me <<--