I’m using 2 tables
Let’s say (There’s more to these tables but that’s just a very simple view of it)
Table1 is
sID ResearchPaperID
1 A1
2 A1
3 A1
4 A1
Table2 is
sID Name
1 Person1
2 Person2
3 Person3
4 Person4
What I need to do is find people who are associated with(co-wrote) Person1’s papers but not show Person1 in the output.
Currently I have something like
SELECT Table2.sID, Table1.sID
FROM Table2, Table1
WHERE Table2.sID = Table1.sID
AND Table2.Name = 'Person1'
which would give me everything that Person1 has done.
This is a homework question been stuck on it for a while now.
Can’t use sub-queries as well.
Sorry I should mention no use of inner joins, outer joins, left/right joins, natural joins.
It’s not supposed to be much harder than what I have above just using basic commands..
[EDIT]
Output would be something like this
ResearchPaperID Name
A1 Person2
A1 Person3
A1 Person4
I want to find people that are co-writers of papers of person1 but not show person1 in the output
Solution, without subqueries and JOIN’s: