Two-Bits
public sql v1 · immutableselect id, category from table1 where id in( select id from ( (select 1 as usort, id from table1 where id in (6, 9)) UNION (select 2 as usort, id from table1 order by priority) ORDER BY usort ) group by category)