I need to dynamically assing the value of level in the code below
That is , if the total count of ArtikelNumber is greater than 1
then set the level to 3
Thanks in Advance
select Col1, Col2,levelfrom Tablewhere (Table.level = ((select Count(*) as ArtikelNumber from Table Where Col1 = 101 and Col2 = 00150 and(Table.Gueltigab <= getdate() and Table.Gueltigbis >= getdate()) group by Col1) > 1) then 3and col3 = 'cash'