Subselect and limit/order?

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: pgsql-sql(at)hub(dot)org
Subject: Subselect and limit/order?
Date: 2000-08-07 14:43:55
Message-ID: 3.0.5.32.20000808004355.02772100@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Just wondering why subselect expressions can not have a limit/order clause,
eg.

select id,(select id from tbl where id > ? order by id limit 1) as nextid
from tbl where id = ?;

is quite usefull.

It can obviously be done in two select statements, but I was just wondering
if it's an oversight or a planner problem?

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-08-07 14:47:53 Re: Functions too slow, even with iscachable?
Previous Message Philip Warner 2000-08-07 12:12:38 Re: Functions too slow, even with iscachable?