![]() ![]() So I needed to find the floor and the ceiling, the two extremes of price ranges in the table, which I was able to do like, BEGINĭECLARE decimal(18, 2) = (Select MIN(FinalPrice) From #Temp(nolock)), decimal(18, 2) = (Select MAX(FinalPrice) From #Temp(nolock)) First the product prices in the resultant table #Temp tend to change. Select SUM(Case When FinalPrice >= 0 And FinalPrice = 100 And FinalPrice = 200 And FinalPrice 0) The closest I have been able to do is this query.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |