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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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