PSQL:CASE / WHEN无法将类型转换为整数

时间:2015-12-10 00:24:44

标签: postgresql psql typeconverter

这是查询的一部分:

(end_date - load_date)*tester_money/(load_date - start_date)

错误:

  

错误:CASE / WHEN无法将类型转换为整数LINE 115:
  什么时候load_date - start_date> 28那么tester_money ......

如何使这项工作?

tester_money属于money类型,日期属于date类型。

1 个答案:

答案 0 :(得分:0)

Think of money as a locale dependent text string. You would have to cast it back to numeric in order to do your calculation. tester_money::numeric

Check out the following link http://www.postgresql.org/docs/current/static/datatype-money.html