InterSystems SQL Reference
A collation function that converts numbers to canonical collation format, then inverts the sign.
||An expression, which can be the name of a column, a number or a string literal, an arithmetic expression, or the result of another function, where the underlying data type can be represented as any character type.
converts numbers or numeric strings to canonical form, inverts the sign, then returns these expression
values in numeric collation sequence.
are functionally identical, except that %MINUS
inverts the sign. It prefixes a minus sign to any number that resolves to a positive number, and removes the minus sign from any number that resolves to a negative number. Zero is never signed.
A number can contain leading and trailing zeros, multiple leading plus and minus signs, a single decimal point indicator (.), and the E exponent indicator. In canonical form, all arithmetic operations are performed, exponents are expanded, signs are resolved to either a single leading minus sign or no sign, and leading and trailing zeros are stripped.
A numeric literal can be specified with or without enclosing string delimiters. If a string contains non-numeric characters, %MINUS
truncates the number at the first non-numeric character, and returns the numeric part in canonical form. A non-numeric string (any string that begins with a non-numeric character) is returned as 0. %MINUS
also returns NULLs as 0.
is an InterSystems SQL extension and is intended for SQL lookup queries.
collation, which sorts a string based on the numeric substrings within the string.
The following example uses %MINUS
to return records in descending numeric order of the home street number:
ORDER BY %MINUS(Home_Street)
Note that the above example orders the integer part of the street address in numerical order. Compare this with the following ORDER BY DESC example, which orders records by street addresses in collation sequence:
ORDER BY Home_Street DESC
Content Date/Time: 2019-02-22 00:52:40