Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sorting in a select - help!

Re: Sorting in a select - help!

From: L120bj <l120bj_at_aol.com>
Date: 1997/03/12
Message-ID: <19970312193301.OAA13191@ladder01.news.aol.com>#1/1

  1. use something like

order by decode(&1,0,size,1,date,...)

2) just add the desc clause after the column to be sorted on e.g. order by date desc

Rob




Subject: Sorting in a select - help!
From: nils_at_bourbon.propertymall.com (Nils) Date: 12 Mar 1997 10:45:15 GMT
Message-ID: <5g61fr$cir_at_bourbon.propertymall.com>

I wish to make a select and have the data sorted, i.e.

    select * from DTABLE

        where
        (
              QTOWN = DTABLE.TOWN
        )
             order by size_000_s ;                      


Questions: (to which, having consulted a couple of books, 
	    I cannot find a solution)

(1) There are 3 different columns by which I could sort, i.e. size, date
and so on - how can I do this - essentially I qould like to pass a parameter QSORT and then sort by size if it is 0, date if it is 1 and so on?

(2) How can I reverse a sort - instead of the reault being sorted lowest
to highest numeric value, I would like it sorted highest to lowest.

Thanks,

Nils Received on Wed Mar 12 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US