In SQl its common to take the SUM of all values from a column
SELECT SUM(column_name)
FROM table_name
WHERE condition;
Can the same thing be done but instead of summing each value in an attribute, each value is "OR'd" together? This would only work if the attribute was boolean of course
CodePudding user response:
MAX(booleancolumn)
will return OR'd together.
(Since TRUE
> FALSE
.)
CodePudding user response:
There are two challenges here:
- SQL doesn't have boolean type
- This isn't part of any of the built-in aggregate functions.
However, some databases will allow you to define your own functions, including aggregate functions. So it is at least possible.