0

Hello, I am trying to do the student evaluation and stuck in this problem.
Each student evaluates himself and all his friends in the same class. I have a sample table below. On the query, I tried to join the table to itself to get a new column calls "StudentID-Change" to list a student himself and his class mates. But I can't get the right result.
SELECT Table1.StudentID, Table1_1.StudentID, Table1.DepartmentID
FROM Table1 LEFT JOIN Table1 AS Table1_1 ON Table1.StudentID = Table1_1.StudentID;

ID StudentID ClassID
1 22 100
2 33 100
3 44 100

Here is the result I want to see in query.
StudentID StudentID-Change ClassID
22 22 100
22 33 100
22 44 100
33 22 100
33 33 100
33 44 100
44 22 100
44 33 100
44 44 100

Can anyone please help? What did I do wrong? Why can’t I get the right result using the that join?
Thanks very much.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by buddylee17
0

It might help if we saw what was in the original table you are querying.
And that's not an inner join, it's just a join.

This topic has been dead for over six months. 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.