custom DRW query

S

skc

I have a list of items in my table:

Name Score
John 3
Mike 5
John 3
Ben 4

etc..

I need to filter this list and pick out all the doubles -
so in the list above it will pull out John and his score.

How do I do this using SQL??

skc
 
B

Bob Lehmann

SELECT name, Sum(score) AS TotalScore FROM TableName
WHERE name = 'John'
GROUP BY name

Bob Lehmann
 
S

skc

I was thinking something like:

SELECT name From Table WHERE If count(name)>2 then show
the name...

I need help with the SQL!
 
B

Bob Lehmann

Obviously!

But, you're going to have to do a better job explaining what you want - The
score?, The name?, both? Do you want to show John's name twice, each with
the corresponding score? Do you just want to show just John's info or all
names where there are duplicates?

Why do you have duplicate names in the table to begin with?

NOTE: Exclamation marks do nothing to increase my sense of urgency. In fact,
I considered not bothering to follow up at all.

Bob Lehmann
 
S

skc

Bob,

Apologies for the exclamation mark.

All I want returned is one name which has 2 or more
occurences. I am not concerned with the score for the
time being, but I want the name and the number of
occurences which must be greater than 2.

skc
 
Top