View previous topic :: View next topic
|
Author |
Message |
RAVIGUPTA1990
New User
Joined: 24 Feb 2016 Posts: 3 Location: india
|
|
|
|
Hi my requirement is ,I have found out the duplicate list from the table but I need to find the list containing the names , like
Code: |
MANISH
MANISH
MANISH
RAVI
RAVI |
I have used the below query for my requirement
Code: |
SELECT (NMFIRST||NMLAST||CHAR(DTBIRTH)||CHAR(ADEMAIL))
FROM TABLE
GROUP BY (NMFIRST||NMLAST||CHAR(DTBIRTH)||CHAR(ADEMAIL))
HAVING COUNT(*)>1
WITH UR; |
My query is just giving me the results of the duplicate values but I need descriptive details like all the duplicates should be visible
Code: |
MANISH
MANISH
MANISH
RAVI
RAVI |
Please help.
Coded, converted to lower case and 'asap' removed |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
RAVIGUPTA1990,
1 - do not SHOUT (use all upper case)
2 - use the code tags to present code, data and cut'n'paste from screen
3 - if you need ASAP hire a consultant
These have all been fixed for you - this time.
You did not show what your results were so we have no idea what you are getting at. |
|
Back to top |
|
|
RAVIGUPTA1990
New User
Joined: 24 Feb 2016 Posts: 3 Location: india
|
|
|
|
I was not saying do it immediately ,i used please .My requirement is to get the list of duplicate values in a table with all occurences |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
ASAP = As Soon As Possible
it does not mean 'please'. 'Please' means 'please' |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Have you thought about what a GROUP BY means in an SQL query? |
|
Back to top |
|
|
RAVIGUPTA1990
New User
Joined: 24 Feb 2016 Posts: 3 Location: india
|
|
|
|
Thanks ,i have got the solution for this . |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
If your table has a primary_key :
Code: |
Select * from Mytable A,
where exists( select * from Mytable B where A.some_columns = b.some_columns and a.PK not = b.PK) |
|
|
Back to top |
|
|
|