× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ah...use the CASE statement I believe. Right SQL people?

On 7/30/07, Ashish Kulkarni <kulkarni_ash1312@xxxxxxxxx> wrote:
Hi
I cannot modify the table, can i add this field 2 on
fly to the SQL statment
i have SQL statement like below
select * from table where Field1 = 'a' or Field1'='c'
or Field1='d' or Field1='b'
So if i can add row number or get the query without
any sort or order by, then would be a great help

Ashish
--- Michael_Schutte@xxxxxxxxxxxx wrote:

Well, if you don't want to order by a,b,c,d... then
you are going to need
a different field to sort on that will put it in the
order you want.

Field1 Field2
a 1
b 4
c 2
d 3


select field1 from file order by field2


Michael Schutte
Admin Professional
Bob Evans Farms, Inc.
"The Secret's the Sauce! Enjoy our new Bob-B-Q
Pulled Pork Knife & Fork
Sandwich!"



java400-l-bounces+michael_schutte=bobevans.com@xxxxxxxxxxxx
wrote on
07/30/2007 11:12:02 AM:

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





____________________________________________________________________________________

Be a better Heartthrob. Get better relationship
answers from someone
who knows. Yahoo! Answers - Check it out.


http://answers.yahoo.com/dir/?link=list&sid=396545433
--
This is the Java Programming on and around the
iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the
archives
at http://archive.midrange.com/java400-l.


--
This is the Java Programming on and around the
iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the
archives
at http://archive.midrange.com/java400-l.






____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.