Position of conditions inside Joins and Wheres simplified