Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154] (may be forged)) by hub.org (8.10.1/8.10.1) with ESMTP id e8NGKTs80350; Sat, 23 Sep 2000 12:20:29 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.0/8.11.0) with ESMTP id e8NGK8B01671; Sat, 23 Sep 2000 12:20:08 -0400 (EDT) To: Paul Wehr cc: Keith Wong , Nelson , Jie Liang , "pgsql-general@hub.org" , "pgsql-novice@hub.org" , "pgsql-sql@hub.org" Subject: Re: [SQL] how to store a query, that results in a table In-reply-to: <39CCB963.2C038BBE@industrialsoftworks.com> References: <39CB65A0.9DEF7ABB@cmet.net> <39CBD205.9A922DDE@ipinc.com> <4.3.2.7.0.20000923111232.00b65758@mail.e-magine.com.au> <39CCB963.2C038BBE@industrialsoftworks.com> Comments: In-reply-to Paul Wehr message dated "Sat, 23 Sep 2000 10:08:35 -0400" Date: Sat, 23 Sep 2000 12:20:07 -0400 Message-ID: <1668.969726007@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200009/682 Paul Wehr writes: > create view complex_view as select blah, ..... , effective_date.date > from tablea, tableb, tablec, effective_date > where tablea.foo=tableb.foo > .... > and effective_date.date between tablec.start_date=tablec.end_date > ; > insert into effective_date values ('09/23/2000'); -- may "fail" if date is > already in the table, but if it is, who cares? > select * > from complex_view > where date='09/23/2000'; Er, why don't you just do select * from complex_view where '09/23/2000' between start_date and end_date; I don't see what the effective_date table is buying ... regards, tom lane