I have been having some trouble working with inner joins I guess:
select count(distinct id)
from svn1,
svn2
where svn1.revno = svn2.revno
and svn1.type = 'Bug'
and svn2.authors IN (select authors
from svn2
where revno = '33')
How to make this faster with inner joins? My query with inner joins gives weird results.
Table Info for svn1:
Columns: id revno type
Data:
1 22 Bug
1 23 Change
1 24 Bug
2 33 Bug
2 34 Bug
Table Info for svn2:
Columns: revno authors
Data:
22 A
22 B
22 C
33 D
33 A
33 C
I want ids of type bug which have a common author with authors of revno 33. i.e ids which also have revno with authors A,D or C in it
In general I also want a query to answer give an id find other ids which have an authors in common.
You need something like this: