typeof
Ensures that the value of an expression is invariant within each aggregate.
Syntax
invar(expression)
Arguments
expression | The expression which must be invariant. |
Description
This function ensures that the value of the specified expression argument does not change within each aggregate set of rows. The select statement containing the call to invar
will terminate with error errINVARMISMATCH
at the first occurrence where the value of expression differs within an aggregate.
Example
select last_name, invar(full_name), count(*) from author natural join book group by 1 having count(*) > 10; last_name invar(full_name) count(*) DickensC Dickens, Charles 14 JamesH James, Henry 14 LongfellowH Longfellow, Henry Wadsworth 11 PotterB Potter, Beatrix 13 TennysonA Tennyson, Alfred 12 TwainM Twain, Mark 11 WhartonE Wharton, Edith 11