any
Returns true if cond_expr is true for at least one row in the aggregate.
Syntax
ANY(conditional_expr)
Arguments
| conditional_expr | The conditional expression. |
Description
This function returns true if for one or more of the rows within an aggregate the conditional expression, cond_expr, evaluates to true.
Example
select full_name, sum(cost), any(cost>10000.00)
from author natural join book where yr_born <= 1800
group by 1;
full_name sum(cost) any(cost>10000.00)
Austen, Jane 42647.00 1
Bacon, Francis 17800.00 0
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 0
Defoe, Daniel 3772.00 0
Descartes, Rene 57692.00 1
Franklin, Benjamin 5080.00 0
Hobbes, Thomas 11153.00 1
Irving, Washington 13998.00 0
Johnson, Samuel 7200.00 0
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