Selects result values that satisfy specified conditions.
| Examples: | Updating Data in a PROC SQL Table Producing All the Possible Combinations of the Values in a Column |
is a valid SQL expression that resolves to a table column whose values are compared to all the when-conditions. See sql-expression.
is an SQL expression that resolves to a value.
proc sql;
select Name, case
when Continent = 'North America' then 'Continental U.S.'
when Continent = 'Oceania' then 'Pacific Islands'
else 'None'
end as Region
from states;
proc sql;
select Name, case Continent
when 'North America' then 'Continental U.S.'
when 'Oceania' then 'Pacific Islands'
else 'None'
end as Region
from states;