sub

a - b, checked.

ScalarDeterministic

Flags

Flag Value
Kind scalar
Nulls a null argument gives null
Deterministic yes
Order matters no
Decomposable no

Example

A pipeline from the language's tested corpus that uses sub, over the example tables.

Hint
from orders
filter qty <= 9
derive {total = amount * 2, plus = qty + 1, net = amount - 1.50, cents = qty % 3, neg = -qty, absq = abs(qty)}

In a plan:

JSON
{
  "args": [
    {
      "col": 2
    },
    {
      "lit": "1.50",
      "type": {
        "kind": "decimal128",
        "precision": 3,
        "scale": 2
      }
    }
  ],
  "fn": "sub"
}