select * ,ROW_NUMBER() OVER (order by id desc) as RowNumber, COUNT(1) OVER() AS recordCount from() temp