【发布时间】:2016-11-03 10:44:04
【问题描述】:
我正在使用 psql (9.1.3)。我有一张桌子(比如说)A
A 有两列:
a_id : 整数
customer_pay : 双精度
我在表格中有这些值。
a_id | customer_pay |--------+--------------+
1733684 | -264.6 | 1723382 | -314.84 | 1728106 | 50.55 | 1741636 | -264.6 | (4 rows)
但是当我这样做时
从 A 中选择 a_id,其中 customer_pay = -264.6;
我什么都没有。
我尝试了所有可能的精度变量,例如 -264.60、-264.00 等。 此查询适用于 +264.6。 如何选择负双精度类型的值。
谢谢你的帮助。
【问题讨论】:
-
我在 Oracle 中运行过这个,看起来不错。
-
我试着把 "",'',etc.Nothing for me in postgres.
-
如果您使用
WHERE ROUND(customer_pay) = -264。有用吗? -
没有。它没有。我试过。 BETWEEN 正在工作
-
如果“customer_pay”是某种货币,double 是错误的数据类型。请改用小数。
标签: mysql postgresql floating-point numeric