every

Returns true if cond_expr is true for every row in the aggregate.

Syntax

every(conditional_expr)

Arguments

conditional_expr The conditional expression.

Description

This function evaluates the specified conditional expression for each row of each aggregate and returns true if cond_expr is true for every row otherwise it returns false.

Example

select full_name, sum(cost), every(cost>1000.00) 
    from author natural join book where yr_born <= 1800 
    group by 1;
    
full_name                           sum(cost)  every(cost>1000.00)
Austen, Jane                         42647.00                   0
Bacon, Francis                       17800.00                   1
Burns, Robert                         1791.00                   0
Carlyle, Thomas                       9641.00                   0
Chaucer, Geoffrey                    46153.00                   1
Coleridge, Samuel Taylor              2833.00                   0
Cooper, James Fenimore               22660.00                   1
Defoe, Daniel                         3772.00                   0
Descartes, Rene                      57692.00                   1
Franklin, Benjamin                    5080.00                   1
Hobbes, Thomas                       11153.00                   1
Irving, Washington                   13998.00                   0
Johnson, Samuel                       7200.00                   1
Milton, John                         19429.00                   0
Paine, Thomas                        32800.00                   1
Raleigh, Walter                      25000.00                   1
Scott, Walter                         4088.00                   0
Shakespeare, William                684940.00                   1
Shelley, Mary Wollstonecraft         23430.00                   1
Swift, Jonathan                       2808.00                   0