0

hi for all....im sabeel...

here's my prob....


i have a column named date

select date from blabla returns all the date

i need to select duplicating dates from blabla....

what is the function to find the duplicating data..?

thanks in Advance....:-)

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Shanti C
0

see an example:

DELETE tablename
FROM tablename,
(SELECT MAX(uid) AS dupid,COUNT(uid) AS dupcnt
FROM tablename
GROUP BY id,url HAVING dupcnt>1)
AS dups
WHERE tablename.uid=dups.dupid;

Here is an example:
uid    id    url
1    20    google.com
2    25    yahoo.com
3    20    google.com
4    25    yahoo.com
5    20    google.com

The above query would delete uid 4 and 5 on the first run and ui 3 on the second run.
0

hello friends....i think you'l got it wrong....

i need to get for example:

name

sabeel
sabeel
sabeel
sabeel

if i could get only the duplicating records thats fine....and i dont want to delete the duplicating records...my query is only to show duplicating records....

0

then write select instead of delete,which i have posted above.....
or simply remove delete query..try with only select...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.