Fixed notice when there is no order by clause