subquery in limit

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: pgsql-hackers(at)postgresql(dot)org
Subject: subquery in limit
Date: 2008-02-15 11:35:28
Message-ID: CA427916-56E1-4175-A6A3-1C29161E0E7D@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(just as an example):
select * from test order by a limit (select count(*)*0.9 from test);

is not doable in postgresql. Someone recently asked on IRC about,
"SELECT TOP 90 PERCENT" type of query in m$sql.
Any ideas how should this be approach in psql. I ask here, because you
guys probably can tell why the first query won't work (subquery is not
allowed as limit's argument, why?).

cheers.

--
Grzegorz Jaskiewicz
gj(at)pointblue(dot)com(dot)pl

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sam Mason 2008-02-15 13:05:16 Re: wishlist for 8.4
Previous Message Richard Huxton 2008-02-15 10:06:49 Re: wishlist for 8.4