How can I rewrite this SQL query to avoid d开发者_开发知识库ivision by zero errors in the ORDER BY?
SELECT * FROM table WHERE age>'30' ORDER BY (a/b) DESC
ORDER BY CASE WHEN b != 0 THEN a / b ELSE 0 END DESC
How can I rewrite this SQL query to avoid d开发者_开发知识库ivision by zero errors in the ORDER BY?
SELECT * FROM table WHERE age>'30' ORDER BY (a/b) DESC
ORDER BY CASE WHEN b != 0 THEN a / b ELSE 0 END DESC
精彩评论