custom DRW query

  • Thread starter Thread starter skc
  • Start date Start date
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
 
SELECT name, Sum(score) AS TotalScore FROM TableName
WHERE name = 'John'
GROUP BY name

Bob Lehmann
 
I was thinking something like:

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

I need help with the SQL!
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Trendy DRW? 1
DRW - PLEASE HELP!!! 4
DRW Question 1
ASP problem: Microsoft VBScript runtime error '800a000d' 17
custom SQL HELP!!! 9
Counting multiple memberships 1
DRW Question.... 3
Looking up values in a table 1

Back
Top