Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coping with duplicate values in a join table.

Status
Not open for further replies.

nuct

Programmer
Sep 5, 2001
103
Hi,

I have the following three tables joined as follows, '>' indicates the join:

Students > Join table < Courses

Unfortunatly the middle table has duplicate records which are causing a query that im doing to count the number of students on a particular course incorrectly.

I can not remove the duplicate values yet so i will have to work with them.

I have tried to use DISTINCT in a view but to no avail.

Are there any other ways to deal with it?

Cheers in advance,

Simon
 
DISTINCT should do it:

SELECT DISTINCT students_info, course_info
FROM join_table;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top