Re: car mileage summation / sledgehammer method

From: Maarten Boekhold <Maarten(dot)Boekhold(at)reuters(dot)com>
To: Oliver Seidel <os10000(at)in-medias-res(dot)com>
Cc: pgsql-sql(at)hub(dot)org, vpaul(at)dohle(dot)com, xy0xy0(at)earthlink(dot)net
Subject: Re: car mileage summation / sledgehammer method
Date: 2000-08-17 11:55:19
Message-ID: 200008171159.e7HBxem98875@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> View definition: SELECT mileage.miles, mileage.date FROM mileage;

> detail=# select mileage.miles, mileage.date, sum(dup.miles) from
> mileage, dup
> where
> dup.date <= mileage.date group by mileage.date, mileage.miles
> order by mileage.date;

Now that's a bit stupid. Why create this view when you can do the same
thing with a table alias (I'm I calling this by the right name?).

select m.miles, m.date, sum(d.miles) from mileage m, mileage d
where.......

Maarten

-----------------------------------------------------------------
Visit our Internet site at http://www.reuters.com

Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Reuters Ltd.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jesus Aneiros 2000-08-17 12:44:51 Re: Help on some SQL command...
Previous Message Guo Bin 2000-08-17 08:59:17 Re: Help on some SQL command...