Adam Ruth <aruth@intercation.com> writes: > Due to the sorting of boolean values, you'd need: > > ORDER BY language = 'DK' desc, language like '%DE' desc, language; Personally I find something like this clearer: ORDER BY (CASE WHEN language = 'DK' THEN 1 WHEN language like '%DE' THEN 2 WHEN ... ELSE 5 END ) -- greg ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org