Using CASE statements
In this exercise, you will use a CASE statement to create a new column which specifies whether the Country is USA or International.
Bu egzersiz
Intermediate SQL Server
kursunun bir parçasıdırEgzersiz talimatları
- Create a new column,
SourceCountry, defined from these cases:- When
Countryis'us'then it takes the value'USA'. - Otherwise it takes the value
'International'.
- When
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
SELECT Country,
CASE WHEN ___ = ___ THEN ___
ELSE ___
END AS ___
FROM Incidents