Advertisement
Guest User

Help with sql statement

a guest
Dec 12th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. "SELECT
  2. CASE
  3. WHEN ingramCost IS NULL THEN verizonCost
  4. WHEN verizonCost IS NULL THEN ingramCost
  5. ELSE LEAST(verizonCost, ingramCost)
  6. END AS smCost
  7.  
  8. FROM phonePrices"
  9. ;
  10.  
  11. What i need is
  12.  
  13. "SELECT name, model, description, maxDP
  14. CASE
  15. WHEN ingramCost IS NULL THEN verizonCost
  16. WHEN verizonCost IS NULL THEN ingramCost
  17. ELSE LEAST(verizonCost, ingramCost)
  18. END AS smCost
  19.  
  20. FROM phonePrices"
  21. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement