Fix SQLRelatedJoin issue when joining on same table maybe?

...ceing the table id.