Does this sort sequence have a name? Or did you make it up?

If it has a name and is already on your iSeries, you can use:
SET OPTION SRTSEQ=xxxxxxxxxxxx before your SQL select

If you made up the sort sequence, you will need to create the sort table
yourself.
Look up the table commands. CRTTBL, RTVTBLSRC, WRKTBL.

If you use table support, be aware that it can mess with selection as well.
For example, create a table where the letter B and b are first in the table.
The do this selection WHERE PRDNO >= 'A' and PRDNO <='D999999999999'. You
might expect B to be in there, but based on the new table, no such luck.

Have fun!

Mike Krebs

-----Original Message-----
From: java400-l-bounces+mkrebs=milwaukeevalve.com@xxxxxxxxxxxx
[mailto:java400-l-bounces+mkrebs=milwaukeevalve.com@xxxxxxxxxxxx] On Behalf
Of Ashish Kulkarni
Sent: Monday, July 30, 2007 10:12 AM
To: java400-l@xxxxxxxxxxxx
Subject: SQL and Order By Question

Hi
I have a table, which i want to sort by value in Key, for example the table
is as below
Key Desc
a This is A
b This is B
c This is C
d This is d

I want to read the result set as

a
c
d
b

How do i write this SQl statement, if i just do order by Key i can get it
either a,b,c,d or d,c,b,a but not the way i want Any ideas

Ashish

A$HI$H




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.