Same

Description

Returns the value that is the same in all the records in the specified attribute.

Syntax

Same ( n )

Arguments

n is a numeric, string, or date expression.

Example

This query returns the same continent value from the IN condition. If cannot find the same value then it returns null.

select Same(continent) as continent from world where country in ( 'Iceland' ,'Croatia','Georgia')

Remarks

Given an attribute, this aggregate function returns a value if all rows in that attribute have the same value or returns null if not all of the rows have the same value. Null values are ignored. If the attribute has all nulls, then null is returned.

See also http://en.wikipedia.org/wiki/Sameness.