Applies to:
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Description
Returns the first element of the specified column for each element of the given parent table. An order by
expression can be set to define the order that should be used to determine the first element.
PU_FIRST can be applied on any data type. The data type of the result is the same as the input column data type.
If no value in the child table exists for the element in the parent table (either because all values of the child table column are filtered out, or because no corresponding value exists in the first place), NULL will be returned.
Syntax
Code Block | ||||
---|---|---|---|---|
| ||||
PU_FIRST ( parent_table, child_table.column [, filter_expression] [, order_by_expression] ) |
Examples
Return the case ID of the smallest case table value for each company code:
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Column1
Column2
|
Return the eventtime of the first activity for each case:
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Column1
Column2
|
Panel | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
activityTable
companyDetailForeign Keys
|
Return the eventtime of the first activity that contains a 'B' for each case:
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Column1
Column2
|
Panel | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
activityTable
companyDetailForeign Keys
|
Return the eventtime of the first activity that contains a 'X' for each case. As there exists no such activity, all activity table values are filtered out, which means that in both cases NULL is returned.
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Column1
Column2
|
Panel | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
activityTable
companyDetailForeign Keys
|