<@DISTINCT
ARRAY=arrayVarName
[COLS=compCol [compType] [, ...]]
[SCOPE=scope] [{array attributes}]>
Returns an array containing the distinct, or unique, rows in the input array.
The ARRAY attribute specifies the name of a variable containing an array. The COLS attribute specifies the column(s) to consider when checking for duplicate rows. Columns can be specified using either column numbers or names, with an optional comparison type specifier (compType).
Valid comparison types are SMART (the default), DICT, ALPHA, and NUM. DICT compares values alphabetically without considering case. ALPHA is a case-sensitive comparison. NUM compares values numerically. SMART checks whether values are numeric or alphabetic and performs a NUM or DICT comparison.
If the COLS attribute is omitted, all columns are considered using the SMART comparison type when eliminating duplicates.
Multiple columns may be specified, separated by commas. Each column specification may include a comparison type specifier. If the comparison type specification is used, it must follow the name or number of the column to be sorted, separated by a space. For example, COLS="1 NUM, 2 DICT" specifies that the first column's values are compared numerically, and the second column's values are compared alphabetically, not case-sensitive.
The SCOPE attribute specifies the scope of the variable specified as the value of the ARRAY attribute. If the scope is not specified, the default scoping rules are used.
There are array-returning attributes that can be used to specify prefixes and suffixes for the returned array, rows within the array, and columns within the rows. They are described in the section Array-to-Text Conversion Attributes. By default, the returned array is formatted as an HTML table.
Meta tags are permitted in any of the attributes.
If the local variable test contains the following array:
<@DISTINCT ARRAY="test" SCOPE="local"> returns:
<@DISTINCT ARRAY="test" COLS="1 NUM" SCOPE="local"> returns:
<@DISTINCT ARRAY="test" COLS="2" SCOPE="local"> returns:
<@FILTER>
<@INTERSECT>
<@SORT>
<@UNION>
Copyright © 1999, Pervasive Software. All rights reserved.