PostgreSQLNumeric FunctionsSIGN
RANDOM

SIGNNumeric Functions

DIV

Returns 1, 0, or -1 for positive, zero, or negative.

Syntax

SIGN(x)

Example

Enter values below to update the example in real time.

profit
direction
financial_records
SELECT profit, SIGN(profit) AS direction
FROM financial_records;