开发者

SQL zero division

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜