MSSQL数値関数SIGN
RAND

SIGN数値関数

PI

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

構文

SIGN(n)

使用例

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

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