pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Wehr <paul@industrialsoftworks.com>
Cc: Keith Wong <keith@e-magine.com.au>
Cc: Nelson <nbrito@cmet.net>
Cc: Jie Liang <jliang@ipinc.com>
Cc: pgsql-general@hub.org <pgsql-general@hub.org>
Cc: pgsql-novice@hub.org <pgsql-novice@hub.org>
Cc: pgsql-sql@hub.org <pgsql-sql@hub.org>
Subject: Re: [SQL] how to store a query, that results in a table
Date: Sat, 23 Sep 2000 12:20:07 -0400
Message-ID: <1668.969726007@sss.pgh.pa.us> (raw)
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>

Paul Wehr <paul@industrialsoftworks.com> 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



view thread (7+ messages)

Message-ID: <1668.969726007@sss.pgh.pa.us>
Permalink:  ../1668.969726007@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1668.969726007@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, paul@industrialsoftworks.com, keith@e-magine.com.au, nbrito@cmet.net, jliang@ipinc.com, 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: <1668.969726007@sss.pgh.pa.us>
  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> <1668.969726007@sss.pgh.pa.us>

* 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