Re: select where in and order

Поиск
Список
Период
Сортировка
От Chris
Тема Re: select where in and order
Дата
Msg-id 4410E85C.3000904@gmail.com
обсуждение исходный текст
Ответ на select where in and order  (Tony Smith <quickcur@yahoo.com>)
Список pgsql-general
Tony Smith wrote:
> I have two tables action and group:
>
> action
> ------------------------
> id,
> name
>
> group:
> ------------------------
> action_id
> rank
>
> I what to select from action table by order by the
> rank in the group table.
>
> If I use
>
> select * from action where id in (select action_id
> from group order by rank)

Why not

select * from action a, group g where a.id=g.action_id order by rank desc;

?

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Предыдущее
От: "Roger Hand"
Дата:
Сообщение: Re: select where in and order
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: select where in and order