PostgreSQL negate a numeric value in resultset

java, postgresql, select-query, sql

Solution

To negate a value, just multiply it with `-1`.

SELECT sales * (-1) from invoice_index;

Problem

I have a query to return a `resultset` of `decimal(30,12)` type data. ``` SELECT sales from invoice_index; ``` This query is giving me output like this: ``` sales ------ 100 -200 300 ``` But I need an output as follow: ``` sales ---- -100 200 -300 ```

Original source