MySQL Forums
Forum List  »  Optimizer & Parser

Join without duplicates
Posted by: Jamie M
Date: November 28, 2011 11:22AM

I have the following three tables and wish to select the competitorName and competitorDescription just once along with all the scores for that competitor.

I have tried several different JOIN queries but the competitorName and competitorDescription are always duplicated based on the number of rows returned from the score table.

Any help would be greatly appreciated! Thanks.

score Table
id competitorId eventId eventScore
1 5 7 12
2 5 8 21
3 6 7 11
4 6 8 23

competitor Table
id competitorName competitorDescription
5 A company description of company
6 Another company description of another company

events Table
id eventName eventDescription
7 Pub Quiz Description of Pub Quiz
8 Snooker Description of Snooker

Options: ReplyQuote

Written By
Join without duplicates
November 28, 2011 11:22AM
November 28, 2011 02:39PM
November 29, 2011 04:19AM
November 29, 2011 02:58PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.