ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » DB2 question

Post new topic  Reply to topic
 DB2 question « View previous topic :: View next topic » 
Author Message
ucbus1
PostPosted: Wed Oct 23, 2002 4:50 am    Post subject: DB2 question Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

Could some body please let me know whether we can order on a substing of a column
say if I want to order by first 5 characters of column1. for example:
Select column1, column2 form Table1 order by substing(column(1:5))
I appreciate if you can please provide me the syntax ,if it is possible
Back to top
View user's profile Send private message Send e-mail
ucbus1
PostPosted: Wed Oct 23, 2002 6:59 am    Post subject: Continued... Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

Let me clarify my requirement. Suppose I have
column1 column2
022131E05 02-022131E05
022132E05 02-022132E05
022135E08 00-022135E08
022132E08 00-022132E08

I want sort such that I get Result set in the following order

column1 column2
022131E05 02-022131E05
022132E08 00-022132E08
022132E05 02-022132E05
022135E08 00-022135E08

How can I achieve this?
Back to top
View user's profile Send private message Send e-mail
vedbhat
PostPosted: Wed Oct 23, 2002 9:43 pm    Post subject: Reply with quote

Disciple

Joined: 19 Mar 2002
Posts: 186
Location: Singapore

Try,

SELECT COLUMN1, COLUMN2 FROM XXX ORDER BY SUBSTR(COLUMN2, 1, 2) DESC, COLUMN1

This should work.
_________________
IBM Certified Solutions Expert - MQSeries Workflow
IBM Certified Specialist - MQSeries
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » DB2 question
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.