【发布时间】:2012-08-01 15:20:24
【问题描述】:
如何将整数查询结果限制为 1。返回 2 为 1,返回 1 为 1,返回 0.5 为 0.5,因为它
这是我的确切查询。
select ((select "V01" from sports where "UID" = '1') * 1.0 ) /
(select "V01" from master where "BALL" = 'REQUIREMENT') ;
我正在使用 postgres。
【问题讨论】:
-
请注意,您不能以整数形式返回 0.5。你需要转换成其他的东西,比如数字才能得到它。
标签: sql postgresql integer