Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Find duplicates of a column with part of column value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Mon Jun 10, 2013 11:21 pm    Post subject: Find duplicates of a column with part of column value
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: 1537
Location: Andromeda Galaxy

PostPosted: Tue Jun 11, 2013 12:10 am    Post subject:
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: 1771
Location: Bloomington, IL

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

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

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Tue Jun 11, 2013 1:26 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us