From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: sub-limiting a query
Date: Sat, 17 Feb 2007 18:47:43 +0100
Message-ID: <20070217174743.GA30380@KanotixBox> (raw)
In-Reply-To: <20070217125634.GA20589@apartia.fr>
References: <20070217125634.GA20589@apartia.fr>
Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org> schrieb:
> ballet,etc.) and I am looking for a select that can return the 10 last
> entered shows AND at most 2 of each type. Is that possible in one query?
A similar question i found in the archive and there are a couple of
answers: (for the second part of your question)
http://archives.postgresql.org/pgsql-sql/2005-03/msg00408.php
But as i said, there is no plain sql-solution. Unfortunately we haven't
windowing functions, but perhaps in the future, Gavin Sharry is working
on this. Take a look at
http://www.gavinsherry.org/blog/index.php?/archives/7-Window-function-presentation.html
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: akretschmer@spamfence.net
Subject: Re: sub-limiting a query
In-Reply-To: <20070217174743.GA30380@KanotixBox>
* 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