ลำดับ 1, 2, 3, 3, 2, 1 v2.ไม่จำเป็นต้องใช้ตารางทั้งหมด
sequence 1, 2, 3, 3, 2, 1 v2.It is not neccessary to use all the tables.
 Badges:  Id [ number]  UserId [ number]  Name [ text]  Date [ time]  Class [ number]  TagBased [ boolean] 
WITH numbers(v) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS n0(x)) SELECT ord = @n * (v + 2 * m) + n, n * (1 - v) + ABS(-@n - 1 + n) * v FROM (SELECT v FROM numbers ORDER BY v LIMIT @n) AS n(n) CROSS JOIN (VALUES (0), (1)) AS s(v) CROSS JOIN (SELECT v - 1 FROM numbers ORDER BY v LIMIT @m) AS m(m) ORDER BY ord