How to assign new serial number to the query results?