Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Counting Records

I don't know if this is possible, but I'm sure one of you guys can figure it out if it is... ;)

I have a table like this

id                    name                   description
-----                -----------              --------------
1111                Mary                    aljkf;lsdjfl;asdjfljdsfjsdj
2222                John                     John Description
3333                John                     John Description
4444                John                     John Description
5555                John                     John Description







The "John" data is old redundant data that serves no significance. I want to go through the data and delete this redundant data if there are 5 or more "John" records.
Is there a way to get back records only if they "repeat" more than, say, 5 times?



thanks!
cdfllc
0
cdfllc
Asked:
cdfllc
1 Solution
 
rafranciscoCommented:
Try this:

SELECT Name
FROM YourTable
GROUP BY Name
HAVING COUNT(*) > 5
0
 
cdfllcAuthor Commented:
Thanks rafrancisco!

You're my new "DBA" ;)
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now