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: More Help Plz

Re: More Help Plz

From: mcstock <mcstockx_at_xenquery.com>
Date: Sun, 2 Nov 2003 21:09:52 -0500
Message-ID: <_rSdncEdiMeGJDiiRVn-jw@comcast.com>


use a decode in the ORDER BY clause (or CASE in versions of oracle that support it)

i.e.:

select groupno, fname || ' ' ||lname
from groups
order by groupno, decode( position, 'LEADER', 1, 2 ), lname, fname

-- 
Mark C. Stock
email mcstock -> enquery(dot)com
www.enquery.com
(888) 512-2048


"Mumblez" <mumblez2002_at_btinternet.com> wrote in message
news:bo4cpd$gvv$1_at_titan.btinternet.com...

> sorry need some more help, i have a table with group members names and one
> of them is the group leader, i have 5 groups and wish to display them with
> the group leader at the top and the members of the group below them in
> aphabetical order
>
> for example
>
> leader group members
> 0001 bill bloggs
> bill adams
> dave collins
> peter smith
> 0002 john mason
> steve bassett
> mike french
> donna welsh
> 0003 brian phillips
> bill hadley
> martin taylor
>
>
> get the idea...............any help with the sql will be greatly
appreciated
>
> Thank you
>
>
Received on Sun Nov 02 2003 - 20:09:52 CST

Original text of this message

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