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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: Order by Ddql results by selected variable then the others in a column

Re: SQL: Order by Ddql results by selected variable then the others in a column

From: Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de>
Date: 07 Oct 98 19:43:35 +0100
Message-ID: <644.584T1785T11834128@rheingau.netsurf.de>


On 06-Okt-98 18:25:37 bonanos wrote:

>Amigos

>PL/SQL Web toolkit

>I want to do an sql statement that allows a person to select companies
>in an area.

>The person chooses his suburb (area)

>The result should first showall companies in his area. and then list
>all other companies.

I have not tested that, but the following has a chance to work:

select * from your_table
order by decode(area,your_area,0,1);

This will sort rows with area=your_area to the top.

Hope that helps,
Lothar

--

Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Schulstr. 12            | lothar.armbruester_at_t-online.de
D-65375 Oestrich-Winkel |

Received on Wed Oct 07 1998 - 13:43:35 CDT

Original text of this message

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