IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Find duplicates of a column with part of column value


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

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Mon Jun 10, 2013 11:21 pm
Reply with quote

Hi,

Is there a way i can fetch duplicates of a column with only part of the value.

Eg: I have a column client_id which is of length 10 in BANKING table. I want to do a select on this table for all duplicate client_id on 1 to 9 characters only.

In BANKING table:

Code:
CLIENT_ID
========
0000000091
0000000093
0000000095
0000000035
0000000065

My query must return 0000000091,0000000093 and 0000000095. Please help. Thanks in Advance
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1566
Location: Andromeda Galaxy

PostPosted: Tue Jun 11, 2013 12:10 am
Reply with quote

Unload the data and sort it to get duplicates alone

or find the values for which duplicates exist and the select the data from table using like
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Jun 11, 2013 12:12 am
Reply with quote

LIKE.
Back to top
View user's profile Send private message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Tue Jun 11, 2013 1:26 am
Reply with quote

Akatsukami wrote:
LIKE.


I need only duplicates from a query. I thought LIKE was for partial search only.
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Can we Insert duplicates in Primary U... DB2 0
No new posts How to find which file contains my se... DFSORT/ICETOOL 6
No new posts NOT ABLE TO FIND DB2 ROWS DB2 2
No new posts COnvert a column with mix of hex ,cha... DB2 5
No new posts Extract part of data from file and wr... DFSORT/ICETOOL 9

Back to Top