Re: Sql request

From: Thomas Kellerer <OTPXDAJCSJVU_at_spammotel.com>
Date: Tue, 01 Dec 2009 08:09:39 +0100
Message-ID: <7njtpbF3m7pikU1_at_mid.individual.net>



Ben Finney, 01.12.2009 02:08:
> Interesting. But you've changed it from a relational to a non-relational
> result (some tuples now contain nulls).

Well that was the initial question, wasn't it? Surpress the repating values. And it is the same solution which I have already posted, just without the join (but the basic idea and technique ist the same)

It also had some other errors
> (referencing names that weren't defined).

I changed the names so that they would not conflict with reserved words. I rather rename columns than create unnecessary sub-selects :)

Putting the partition into the WINDOW clause at the end will only work for Postgres, not for Oracle or DB2 (they don't support that). An for just a single usage of the window it doesn't add to the clarity in my opinion. But formatting (and the usage of unnecessary sub-select) is a matter of personal style!

Regards
Thomas Received on Tue Dec 01 2009 - 01:09:39 CST

Original text of this message