select case with “over partition by”
问题 What's the correct syntax or is it possible to use case in a select and in it partition by? (using sql server 2012) a = unique id b = a string'xf%' c = values d = values e = values select case when b like 'xf%' then (sum(c*e)/100*3423 over (partition by a))end as sumProduct from #myTable this is something i need to solve which is a part of a problem i had previously sumProduct in sql edit : upon request adding some sample data and expected result create table #testing (b varchar (20), a date,