Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 107
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: 1567
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: 1790
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: 107
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 Find out which PSB is currently sched... Andi1982 IMS DB/DC 0 Mon Sep 24, 2018 3:16 pm
No new posts How to find if segment is read in any... Priyanka AR IMS DB/DC 12 Thu Sep 20, 2018 1:34 pm
No new posts Sort card to find duplicates, without... anand1204 DFSORT/ICETOOL 15 Fri Aug 31, 2018 12:13 am
No new posts CLOB Column data to External File usi... lalitmehta12 DB2 9 Tue Aug 21, 2018 7:22 pm
No new posts USS: Find and replace string within a... vasanthz All Other Mainframe Topics 5 Thu Aug 02, 2018 4:01 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us