0

I have written a mysql query-
SELECT questions.id,questions.date,questions.title,users.user_name,subjects.subject FROM questions INNER JOIN topics ON questions.topic_id=topics.id INNER JOIN subjects topics.subject_id=subjects.id INNER JOIN users ON subjects.id=users.sub1 OR subjects.id=users.sub2 WHERE users.id=8;
which is giving error-

1066 - Not unique table/alias: 'topics' .i am unable to understand the problem.

2
Contributors
1
Reply
4
Views
5 Years
Discussion Span
Last Post by yamahaszr660
0

daniel,
you're missing a on in the INNER JOIN subjects topics.subject_id=subjects.id
should be INNER JOIN subjects on topics.subject_id=subjects.id

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.