updated map user sql query