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
 

 

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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


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