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
 
Wanna to retrive only the duplicate values in the table

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

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Apr 24, 2006 3:32 pm    Post subject: Wanna to retrive only the duplicate values in the table
Reply with quote

Hi all,


I wanna to retrive only the duplicate values in the table. Can any one let me know if u have solution in ur hand. plz... icon_sad.gif
Back to top
View user's profile Send private message

shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Mon Apr 24, 2006 3:51 pm    Post subject:
Reply with quote

Code:
SELECT columns
FROM table
GROUP BY columns
HAVING COUNT(*) > 1

To retrieve duplicate Rows from the table


Correct Me if I am Wrong

Thanks
Shri
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Apr 24, 2006 5:55 pm    Post subject: Re: Wanna to retrive only the duplicate values in the table
Reply with quote

Abbu,

Did you search before....http://ibmmainframes.com/viewtopic.php?t=4390

Regards,
Priyesh.
Back to top
View user's profile Send private message
vidhyanarayanan

New User


Joined: 23 Dec 2005
Posts: 52

PostPosted: Mon Apr 24, 2006 6:41 pm    Post subject:
Reply with quote

Hi,
U can use "UNION ALL" to retrieve only duplicates.
Back to top
View user's profile Send private message
appasi

New User


Joined: 12 Dec 2005
Posts: 20
Location: Bangalore

PostPosted: Mon Apr 24, 2006 7:58 pm    Post subject:
Reply with quote

Hi,

What shrivatsa has said is one of the way to retrive only duplicate values from a table

Thanks
Appasi
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Apr 24, 2006 9:15 pm    Post subject: retriving duplicate rows
Reply with quote

Hi all,

Thank u i got that.. all ur suggestions are working..

Priyesh,

I was in hurry i could not find the search result properly. any way thanks....

Thank u for all of u...
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 Extracting DDL for all list of intere... Ashishpanpaliya DB2 5 Mon May 21, 2018 4:08 pm
No new posts LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am
No new posts Duplicate PARM on OUTFIL sancraig16 SYNCSORT 11 Thu Apr 05, 2018 10:25 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm

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