updates on selects and group by