daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select *,  "Price Range" =
  2.   CASE
  3.      WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
  4.      WHEN ListPrice < 50 THEN 'Under $50'
  5.      WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
  6.      WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
  7.      ELSE 'Over $1000'
  8.   END
  9.   FROM Production.Product
  10.       ORDER BY ProductNumber
  11.    
  12. select *,
  13.   CASE
  14.      WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
  15.      WHEN ListPrice < 50 THEN 'Under $50'
  16.      WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
  17.      WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
  18.      ELSE 'Over $1000'
  19.   END AS [Price Range]
  20.   FROM Production.Product
  21.       ORDER BY ProductNumber
  22.    
  23. SELECT p.ProductName,
  24.   CASE
  25.      WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
  26.      WHEN ListPrice < 50 THEN 'Under $50'
  27.      WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
  28.      WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
  29.      ELSE 'Over $1000'
  30.   END AS Price_Range
  31. FROM Product p
  32.    
  33. SELECT  *  ,
  34.         CASE
  35.             WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
  36.             WHEN ListPrice < 50 THEN 'Under $50'
  37.             WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
  38.             WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
  39.             ELSE 'Over $1000'
  40.         END AS "Price Range"
  41. FROM    Production.Product
  42. ORDER BY ProductNumber
  43.    
  44. select *,
  45.   CASE  
  46.      WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
  47.      WHEN ListPrice < 50 THEN 'Under $50'
  48.      WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
  49.      WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
  50.      ELSE 'Over $1000'
  51.   END as [Price Range]
  52.   FROM Production.Product
  53.       ORDER BY ProductNumber
  54.    
  55. select *, "Price Range" =
  56.  CASE
  57.     WHEN ListPrice =  0 THEN 'Mfg item - not for resale'
  58.     WHEN ListPrice < 50 THEN 'Under $50'
  59.     WHEN ListPrice >= 50 and ListPrice < 250 THEN 'Under $250'
  60.     WHEN ListPrice >= 250 and ListPrice < 1000 THEN 'Under $1000'
  61.  ELSE 'Over $1000'
  62.  END
  63.     FROM Production.Product
  64.     ORDER BY ProductNumber
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top