SQL排除负数
请帮忙,有一个请求,其中有时 KOLVO_RZ 列中存在负值。是否可以在请求中检查这一点,如果该值为负数,则返回 0?
SELECT KOLVO_T - KOLVO_KKM - KOLVO_RZ AS KOLVO_T
FROM PRICE
Please help, there is a request in which sometimes there is a negative value in the KOLVO_RZ column. Is it possible to check this in the request and if the value is negative, then return 0?
SELECT KOLVO_T - KOLVO_KKM - KOLVO_RZ AS KOLVO_T
FROM PRICE
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这应该可以解决问题:
This should do the trick:
这是适用于我的 InterBase 2020 的示例。您使用的是哪个 InterBase 版本?
然后,我成功执行以下查询。
Here's a sample that works for me with InterBase 2020. Which InterBase version are you using?
and then, I execute the following queries successfully.