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

Query required - New


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

New User


Joined: 24 Jul 2012
Posts: 5
Location: india

PostPosted: Mon Aug 06, 2012 3:59 pm
Reply with quote

data thatis in table

01
02
03
04
05
06
07
08
09
10
11
12

i want the ou[put like:

01,02,03,04,05,06,07,08,09,10,11,12


how to format using the query


plz help me
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Aug 06, 2012 4:49 pm
Reply with quote

not that it is any faster but this also works :
Code:
where translate(substr(col1,1,1),'','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = ''
and translate(substr(col1,2,4),'','0123456789') = ''


and you could add following to limit the tablescan (if an index exists)
Code:
and col1 between 'A' and 'Z'

about omitting the criteria in your select, and test it in your program :
A lot more rows will have to be transported from DB2 to your program =
A lot more fetches will need to be done =
more cpu
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Mon Aug 06, 2012 5:06 pm
Reply with quote

Hi Muthupandi,

Don't reuse old posts, but open a new topic, and provide all neccessary information on your SQL query including what you have tried yourself. Remember, this is not a please do my homework for me forum, but a forum for help when people get stuck in a problem.

Dick or any moderator, please lock this thread.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 06, 2012 5:15 pm
Reply with quote

muthupandi.

This is also a duplicate of one in the DFSORT forum. Please one topic for one question.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 06, 2012 7:00 pm
Reply with quote

Hello,

Are you looking for a database solution or a sort solution?

The answer is not "both". . .
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 Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top