Reputation: 33554
Consider example:
case when type = 'myValue' then 'default' else type end
how to listed several values here type = 'myValue'
? Instead of duplicating:
case
when type = 'myValue' then 'default'
when type = 'other' then 'default'
else type
end
Upvotes: 3
Views: 53
Reputation: 311498
You can use any condition in a when
clause. E.g., in your case, you could use the in
operator:
case
when type in ('myValue','other') then 'default'
else type
end
Upvotes: 2