Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: Order by Ddql results by selected variable then the others in a column
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
![]() |
![]() |