BUG #3282: Added ability to subselect with in left or inner join