IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Wanna to retrive only the duplicate values in the table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Apr 24, 2006 3:32 pm
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: 174
Location: Bangalore

PostPosted: Mon Apr 24, 2006 3:51 pm
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: 1448
Location: Chicago, IL

PostPosted: Mon Apr 24, 2006 5:55 pm
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
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
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: 677
Location: NJ

PostPosted: Mon Apr 24, 2006 9:15 pm
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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts To Discard record with 0 entry if Dup... SYNCSORT 7
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Extract ISPF table column headings CLIST & REXX 2
Search our Forums:


Back to Top