Jan de Visser wrote:
> On Thursday 11 May 2006 16:34, Karen Hill wrote:
> > It seems PostgreSQL doesn't have a TOP Predicate. Why is that? Here
> > is an example:
> >
> > SELECT TOP 10 products from sales;
>
> Just for my understanding: This would return the 10 products with the most
> matching
Tom Lane wrote:
> "Karen Hill" <[EMAIL PROTECTED]> writes:
> > It seems PostgreSQL doesn't have a TOP Predicate. Why is that?
>
> It's not in the SQL standard. If we were to implement something like
> what I think you're asking for (your example is way underspecified),
> it'd probably look like
Have you tried using the LIMIT clause?
select porducts from sales limit 10;
http://www.postgresql.org/docs/8.1/interactive/queries-limit.html
On Thu, 11 May 2006, Karen Hill wrote:
It seems PostgreSQL doesn't have a TOP Predicate. Why is that? Here
is an example:
SELECT TOP 10 products fro
Karen Hill wrote:
It seems PostgreSQL doesn't have a TOP Predicate. Why is that? Here
is an example:
SELECT TOP 10 products from sales;
Just use:
SELECT product from sales limit 10
OR
SELECT products from sales order by products desc limit 10;
Joshua D. Drake
--
On Thursday 11 May 2006 16:34, Karen Hill wrote:
> It seems PostgreSQL doesn't have a TOP Predicate. Why is that? Here
> is an example:
>
> SELECT TOP 10 products from sales;
Just for my understanding: This would return the 10 products with the most
matching sales rows, right?
jan
--
--
"Karen Hill" <[EMAIL PROTECTED]> writes:
> It seems PostgreSQL doesn't have a TOP Predicate. Why is that?
It's not in the SQL standard. If we were to implement something like
what I think you're asking for (your example is way underspecified),
it'd probably look like SQL2003's window functions.