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: Order by Ddql results by selected variable then the others in a column

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

From: Matthew MacFarland <matthew_macfarland_at_dril-quip.com>
Date: Tue, 6 Oct 1998 14:18:01 -0500
Message-ID: <6vdqc0$j4j$1@uuneo.neosoft.com>


Hello,

Try a union query like:

SELECT customerid,name,city,1 AS sort
FROM customers
WHERE city = 'Houston'
UNION
SELECT customerid,name,city,2 AS sort
FROM customers
WHERE city != 'Houston'
ORDER BY sort, name

Matthew MacFarland
Dril-Quip, Inc.
matthew_macfarland_at_dril-quip.com

bonanos_at_yahoo.com wrote in message <6vdjqh$6c7$1_at_nnrp1.dejanews.com>...
>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.
>
>Must I do two sql statements.
>
>Muchos Gracious in advance
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Oct 06 1998 - 14:18:01 CDT

Original text of this message

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