I am trying to order rows by string column like this:
select * from cards
order by (case gate
when 'mastercard' then 1
when 'visa' then 2
when 'fibi' then 3
when 'uzcard' then 4
when 'humo' then 5
end)
But I want mastercard and visa have the same index. I tried something like this:
select * from cards
order by (case gate
when 'mastercard' or 'visa' then 1
when 'fibi' then 2
when 'uzcard' then 3
when 'humo' then 4
end)
but I get this error:
ERROR: invalid input syntax for type boolean
when 'mastercard' then 1andwhen 'visa' then 1.