SHARE
TWEET

65

a guest Jun 12th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT (ROW_NUMBER() OVER (ORDER BY maker, num)),
  2. (CASE
  3. WHEN ROW_NUMBER() OVER(PARTITION BY maker ORDER BY A.num) = 1
  4. THEN MAKER
  5. ELSE '' END), type
  6.  
  7. FROM
  8. (SELECT
  9. DISTINCT maker, type,
  10. CASE
  11. WHEN type='PC' THEN 1  
  12. WHEN type='laptop' THEN 2
  13. ELSE 3 END AS num
  14. FROM product) AS A
  15.  
  16. GROUP BY type, A.num, maker
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