Thread: Order by question

Order by question

From
Kevin Kempter
Date:
Hi All;

I'm selecting 3 columns.  I want to order the results ascending by col1 and
col2 and then descending by col3

Whats the syntax for this?


Thanks in advance

Re: Order by question

From
"Grzegorz Jaśkiewicz"
Date:


On Wed, Nov 26, 2008 at 7:46 PM, Kevin Kempter <kevink@consistentstate.com> wrote:
Hi All;

I'm selecting 3 columns.  I want to order the results ascending by col1 and
col2 and then descending by col3

Whats the syntax for this?
select * from foo order by a,b asc, c desc;
?


--
GJ

Re: Order by question

From
Andreas Kretschmer
Date:
Kevin Kempter <kevink@consistentstate.com> schrieb:

> Hi All;
>
> I'm selecting 3 columns.  I want to order the results ascending by col1 and
> col2 and then descending by col3
>
> Whats the syntax for this?

order by col1 asc, col2 asc, col3 desc;


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: Order by question

From
Thomas Kellerer
Date:
Kevin Kempter wrote on 26.11.2008 20:46:
> Hi All;
>
> I'm selecting 3 columns.  I want to order the results ascending by col1 and
> col2 and then descending by col3
>
> Whats the syntax for this?

ORDER BY col1 ASC, col2 ASC, col3 DESC

this is documented in the manual