Division ( / ) not giving my answer in postgresql
问题 I have a table software and columns in it as dev_cost , sell_cost . If dev_cost is 16000 and sell_cost is 7500. How do I find the quantity of software to be sold in order to recover the dev_cost ? I have queried as below: select dev_cost / sell_cost from software ; It is returning 2 as the answer. But we need to get 3, right? What would be the query for that? Thanks in advance. 回答1: Your columns have integer types, and integer division truncates the result towards zero. To get an accurate