SELECT MAX("ID") "max_ID", MAX("ID") + 1 "new_ID", "year" FROM "orders" WHERE "year" = YEAR( NOW()) GROUP BY "year"