Row_number (), rank (), dense_rank (), ntile (N)

Source: Internet
Author: User
-- 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.