Re: select where in and order - Mailing list pgsql-general

From Chris
Subject Re: select where in and order
Date
Msg-id 4410E85C.3000904@gmail.com
Whole thread Raw
In response to select where in and order  (Tony Smith <quickcur@yahoo.com>)
List 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 by date:

Previous
From: "Roger Hand"
Date:
Subject: Re: select where in and order
Next
From: Stephan Szabo
Date:
Subject: Re: select where in and order