I have a mysql query that uses bit_or on a result set. When there is no result set, the bit_or function returns 0 (this is correct as per the mysql documentation).
For example:
select n from t1 where a=1;
Returns no rows.
select bit_or(n) from t1 where a=1;
Returns 0
I need to force the last query to instead return no result from the bit_or query, e.g. (in pseudo-code, because I do not know the correct invocation):
select bit_or(n) unless 0 from t1 where a=1;
Does anybody know how I can do this? (Clarification, I need the "no result on 0" return value for an external program, which unfortunately cannot be changed).