selectUnion()

Overview

public query function selectUnion(
      required array   selectDataArgs
    ,          string  union          = "DISTINCT"
    ,          string  orderBy        = ""
    ,          numeric maxRows        = 0
    ,          numeric startRow       = 1
)

Performs a UNION SELECT of two or more SQL queries. Accepts an array of structs of selectData() arguments.

Arguments

NameTypeRequiredDescription
selectDataArgsarrayYesAn array of structs of arguments to be passed to each selectData in the union.
unionstringNo (default="DISTINCT")The type of UNION join: DISTINCT (default) or ALL
orderBystringNo (default="")The sort order for the final dataset. Can only be column names contained in the first query, and not prefixed with object names
maxRowsnumericNo (default=0)Maximum number of rows to select
startRownumericNo (default=1)Offset the recordset when using maxRows