Quelque chose du genre :




SELECT worder, id, type,
CASE WHEN type = 13 THEN 1203 + MOD(ROW_NUMBER() OVER(PARTITION BY type ORDER BY WORDER),2))
WHEN type = 19 THEN 2101 +...