[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Order By Problem



Stan
I am using Oracle and the DECODE() function worked great. Saves a bunch of
trying to work-around code.

Thanks to everybody in the user group. I appreciate you help. This has been
bugging me for a month.

Thanks again
Dave Benzenhafer

-----Original Message-----
From: Stan Quick [mailto:stanley.quick@BRIO.COM]
Sent: Thursday, February 22, 2001 1:44 PM
To: SQR-USERS@list.iex.net
Subject: Re: Order By Problem


If you're using Oracle (and since your list looks short enough), you could
use the DECODE statement

ORDER BY DECODE (FIELDNAME,10489,1,12473,2,10489,3,12553,4,...)

Stan

-----Original Message-----
From: Benzenhafer, Dave [mailto:DBenzenhafer@DEEPWATER.COM]
Sent: Thursday, February 22, 2001 1:59 PM
To: SQR-USERS@list.iex.net
Subject: Re: Order By Problem


Below you can see the other field associated with the number code. I need to
Order By on this Criticality field. I hope this helps to explain.

As is               I need it to order by like this
10489 Shutdown            10492 Safety
10490 Critical            12473 Safety Critical
10491 Normal              10489 Shutdown
10492 Safety              12553 Op Critical
12473 Safety Critical     10490 Critical
12474 Operational Std     12474 Operational Std
12475 On Request          10491 Normal
12553 Op Critical         12475 On Request

Dave Benzenhafer

-----Original Message-----
From: Rick_Creel@AONCONS.COM [mailto:Rick_Creel@AONCONS.COM]
Sent: Thursday, February 22, 2001 12:26 PM
To: SQR-USERS@list.iex.net
Subject: Re: Order By Problem


What kind of order are you wanting?  What you want looks like random order
to
me.  Are there any other fields that help determine the order?





"Benzenhafer, Dave" <DBenzenhafer@DEEPWATER.COM> on 02/22/2001 01:06:37 PM

Please respond to sqr-users@list.iex.net

To:   SQR-USERS@list.iex.net
cc:    (bcc: Rick Creel/IT/Aon Consulting)

Subject:  Order By Problem



I have a number field that I would like to change the sort order by without
creating another table to sort by if possible. Not all of the numbers show
up in every report. The Table the field comes from looks like this.

As is           I need it to order by like this
10489                   10492
10490                   12473
10491                   10489
10492                   12553
12473                   10490
12474                   12474
12475                   10491
12553                   12475

I have tried instr() without much success. Is it possible to use something
like the instr() function to change the sort order of a field.

Thank You in advance for you help and time.
Dave Benzenhafer