filmov
tv
SQL SERVER||How to write CASE Statement in IN Clause?
Показать описание
SELECT *,
CASE WHEN city IN('New York','Los Angeles','Chicago','Houston') THEN 'United States'
WHEN city IN('Mumbai','Delhi','Chennai','Kolkata') THEN 'India'
ELSE 'Australia'
END AS Country
FROM emp
CASE WHEN city IN('New York','Los Angeles','Chicago','Houston') THEN 'United States'
WHEN city IN('Mumbai','Delhi','Chennai','Kolkata') THEN 'India'
ELSE 'Australia'
END AS Country
FROM emp