PostgreSQL숫자 함수SIGN
RANDOM

SIGN숫자 함수

DIV

양수는 1, 0은 0, 음수는 -1을 반환합니다.

문법

SIGN(x)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

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