Added a condition for when joining tables on themselves it skips referenceing the table id.
Merge pull request #1 from magicaltrevor/master

Fix SQLRelatedJoin issue when joining on same table maybe?