case when
Loading
case when
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Apr 24, 2022, 6:37 AM EDT
Uttam KumarRank #1,076 · 1.8K reputationPosted Apr 20, 2022, 3:25 AM EDT
Ravinder SharmaRank #1,211 · 1.5K reputationPosted Apr 20, 2022, 10:09 PM EDT
Md SarfarajRank #194 · 12.4K reputationPosted Apr 21, 2022, 1:16 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Apr 24, 2022, 1:31 PM EDT
Anupam MaitiRank #295 · 8.5K reputationPosted Apr 26, 2022, 2:41 AM EDT
Kapil Singh KumawatRank #735 · 3.2K reputationPosted Apr 25, 2022, 6:11 AM EDT
Hello,
Here is the sample example of using case in sql server
--Simple CASE expression: CASE input_expression WHEN when_expression THEN result_expression [ ...n ] [ ELSE else_result_expression ] END
for more info please refer Microsoft Docs-
https://docs.microsoft.com/en-us/sql/t-sql/language-elements/case-transact-sql?view=sql-server-ver15