Improve 'LEFT JOIN' generation for internal relations.

Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
Merge pull request #1313 from ashutoshdhundhara/internal_relations

Improve 'LEFT JOIN' generation for internal relations.