MySQLNumeric FunctionsSIGN
RAND

SIGNNumeric Functions

PI

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

Syntax

SIGN(x)

Example

Enter values below to update the example in real time.

order_id
profit
direction
financial_records
-- 손익 방향 표시
SELECT order_id, profit, SIGN(profit) AS direction
FROM financial_records;