Created
April 6, 2016 12:47
-
-
Save imrexhuang/185a69803dc7c09ce9bdcc5221699f15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--SQL Server 2012 T-SQL資料庫設計 (悅知文化) | |
--http://www.delightpress.com.tw/book.aspx?book_id=skud00022 | |
--CH06 P.363 | |
USE Northwind | |
SELECT ProductID,UnitPrice, | |
CASE | |
WHEN UnitPrice < 50 THEN '低於 50' | |
WHEN UnitPrice >= 50 AND UnitPrice<100 THEN '低於 100' | |
WHEN UnitPrice >= 100 AND UnitPrice<500 THEN '低於 500' | |
ELSE '高於 500' | |
END AS 價格類別 | |
FROM Products | |
ORDER BY 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment