For Example:
DECLARE @ProductTotals TABLE
(
IsExpired bit
)
INSERT INTO @ProductTotals (IsExpired) values(1),(0)
I need a output : first row 0 second row 1.
Do not use case operator.
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 attend4days leftRegister
Ruchi SharavatRank #1,714 · 885 reputationPosted Jul 30, 2018, 8:23 PM EDT
Jeeva SubburajRank #720 · 3.3K reputationPosted Jul 30, 2018, 4:52 AM EDT
Kapil Singh KumawatRank #735 · 3.2K reputationPosted Aug 1, 2018, 9:30 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 1, 2018, 11:58 PM EDT
set IsExpired=IIF(IsExpired=0,1,0)
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 5, 2018, 7:20 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Aug 9, 2018, 4:58 PM EDT