Re: [Fwd: Re: no ORDER BY in subselects?]

Поиск
Список
Период
Сортировка
От Frank Bax
Тема Re: [Fwd: Re: no ORDER BY in subselects?]
Дата
Msg-id 3.0.6.32.20000921115010.0097e1b0@execulink.com
обсуждение исходный текст
Ответ на Re: [Fwd: Re: no ORDER BY in subselects?]  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: [Fwd: Re: no ORDER BY in subselects?]
Список pgsql-sql
At 11:29 AM 9/21/00 +1000, you wrote:
>The main reason I use them is to find the 'next' or 'previous' record in a
>list (eg. next date, next ID). eg.
>
>  select <whatever>, (select ID from table where id > this.id 
>  order by id asc limit 1) as next_id ...

Doesn't this give the same result (without order by):

>  select <whatever>, (select min(ID) from table where id > this.id) as
next_id

Frank



В списке pgsql-sql по дате отправления:

Предыдущее
От: Sergio de Almeida Lenzi
Дата:
Сообщение: Re: sql query not using indexes
Следующее
От: "Brian C. Doyle"
Дата:
Сообщение: Multiple Index's