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....:-)

Recommended Answers

All 4 Replies

select date, count(date) from blabla
group by date

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.

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....

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.