Loading

try_sub

Scalar function

Subtract two UINT256 values, returning NULL if underflow occurs. Follows DuckDB's try_* convention for safe arithmetic.

try_sub(UINT256, UINT256)

Parameters

Name Type
a UINT256
b UINT256

Returns

Name Type
difference UINT256
1
SELECT try_sub(balance, withdrawal) AS new_balance;
Notebook ready in readonly mode.