CASE IN SQL SERVER WHERE CLAUSE -


i need query below contains case in clause

 declare @billback int  set @billback=1   select       coloumn1, coloumn2, coloumn3, [project_id]         [purchase_details]        (case when @billback = 0                [project_id] = 0            when @billback = 1                 [project_id] != 0        end         or [project_id] in (1, 2, 3)      ) 

above query gives error, please me in different way

based on positioning of case ... when, appears trying following:

 select colomn1, column2, column3, [project_id]   [purchase_details]        [project_id]  in (1,2,3)      or ((@billback = 0 , [project_id] = 0)          or (@billback = 1 , [project_id] <> 0)); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -