-- Dynamic add field -- The Case search function (multiple condition judgments) adds a select row_number () over (order by [realprice] DESC) A, [saleid], -- (case when realprice> 0 and realprice <= 100 then 'low-end production' -- When realprice> 100 and realprice <= 500 then 'middle-end production' -- When realprice> 500 and realprice <= 1000 then 'high-end product' -- When realprice> 1000 then 'low-end product' -- else' no price' -- end) set name -- the above method can also 'set name' = (case when realprice> 0 and realprice <= 100 then 'low-end production' when realprice> 100 and realprice <= 500 then' mid-end product 'when realprice> 500 and realprice <= 1000 then' high-end product 'when realprice> 1000 then' low-end product 'else' no price' end ), [name], [unitprice], [realprice], [createdtime], [creator], [enabled], [storageid] from [Shop]. [base]. [sale] order by saleid DESC
From: http://www.cnblogs.com/hacker012/archive/2011/06/13/2079670.html
Http://www.cnblogs.com/hacker012/archive/2011/06/14/2080680.html