0

I have a single table that uses test# as the primary key. Here is what that table looks like:

Test# Name VerbalScore readingScore    Notes
  1   Bobby  92                       Good job
  2   Bobby                  40       You Suck Bobby 

The problem is I want to view and be able to see when there are multiple verbal scores for the same Name (so be able to see if the person took the same test more than once).

I want to have some kind of select statement to get this result from the above table:

1   Bobby   92   40   Good job, You Suck Bobby

Is that possible?

1 Answer 1

1

I am not totally sure I understand what you mean by "see when there are multiple verbal scores" but with mysql 5+, try

SELECT
   Name,
   GROUP_CONCAT(VerbalScore),
   GROUP_CONCAT(readingScore),
   GROUP_CONCAT(Notes)
FROM
   myTable
GROUP BY
   Name;

GROUP_CONCAT is a mysql specific grouping function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.