PGSQL自定义排序:
ORDER BY
t.code,
t.product_id,
t.data_type,
CASE t.settlement_node
WHEN '4' THEN 1
WHEN '0' THEN 2
WHEN '1' THEN 3
WHEN '3' THEN 4
WHEN '2' THEN 5
WHEN '5' THEN 6
END,
t.from_site_id,
t.to_site_id ASC
MySQL自定义排序
field(t.settlement_node,'4',''2,'3')