Sort clause added (not tested)
Having sub queries support