Skip to content
  1. Home
  2. Docs
  3. Reference
  4. SQL Reference
  5. SQL Functions (New)

SQL Functions (New)

ABS

This returns the absolute value of a numerical value. An ABS on a Float literal returns a MONEY type, whereas an ABS on a Float column returns a Float64 type.

Arguments

ABS(num)

Argument num can be numeric or of type integer or float. ABS is not supported for Boolean type. An ABS(NULL) is a NULL.

SQL Example

SELECT ABS(-1) FROM <TABLE> LIMIT 1

Examples

VALUEABS(VALUE)Return Type
00Int64
-11Int64
NULLNULLN/A
0.010.01Money
TRUE<Unsupported><Unsupported>

ADD_MONTHS

This function adds months to a date in string format, returning a result which is a date in string format.

Arguments

ADD_MONTHS(start_date, num_months)

Where start_date is a string in DATE format YYYY-MM-DD. The return value is in a Xcalar TIMESTAMP format.

SQL Example

SELECT ADD_MONTHS('2007-08-03', 4) from <TABLE> LIMIT 1

The above should return

2007-12-03T00:00:00.000Z
Was this article helpful to you? Yes No

How can we help?