IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Help needed in DB2 Query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chidu13

New User


Joined: 07 Nov 2008
Posts: 2
Location: US

PostPosted: Thu Apr 02, 2009 10:03 am
Reply with quote

Hi,

I needed to pick rows from a column(field) in DB2 table depending on some characters in that column.

For ex if the field length is from 1 to 10 positions , i need to pick all the rows in that column which has 9th and 10th column ='US'.

Please can anyone help me how to do search for a string?

Thanks,
chidu
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu Apr 02, 2009 10:12 am
Reply with quote

Chidu,
This will do for you
SUBSTR(A.FieldName,9,2) = 'US'
Back to top
View user's profile Send private message
chidu13

New User


Joined: 07 Nov 2008
Posts: 2
Location: US

PostPosted: Thu Apr 02, 2009 10:20 am
Reply with quote

Yes this does work .. thankyou
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu Apr 02, 2009 10:21 am
Reply with quote

Chidu,
You are welcome.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
Search our Forums:

Back to Top