How to use Case Statement for Conditional Formatting in Select Query - TSQL Tutorial Part 116

preview_player
Показать описание
SQL Server / T-SQL Tutorial Scenario:
How to use Case Statement for Conditional Formatting in Select Query

You are working as SQL Server developer, you need to query dbo.Customer table that has CountryShortName column with country abbreviations. You want to generate another columns with Country Full name by using CountryShortName column values. How would you do that?

Link to scripts used in SQL Server / TSQL Tutorial Video

Check out our website for Different SQL Server, MSBI tutorials and interview questions
such as SQL Server Reporting Services(SSRS) Tutorial
SQL Server Integration Services(SSIS) Tutorial
SQL Server DBA Tutorial
SQL Server / TSQL Tutorial ( Beginner to Advance)
Рекомендации по теме
Комментарии
Автор

If you are working with a column you had to create and did not exsit in the table ex: (year(to_date(CURRENT_DATE)) - year(to_date(disable_dt))) as Disability_Year,


How would you write a case statent: if 'Disability_YEAR' in (1, 2, 3, 4, 5, 6) then '0'
else 'Year'

chandnikaul