MySQL数値関数SIGN
RAND

SIGN数値関数

PI

正は1、0は0、負は-1を返します。

構文

SIGN(x)

使用例

下記の値を入力するとサンプルに即時反映されます。

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