I suddenly experienced a query on my production site returning no results but also producing no errors, it was just returning zero rows. Come to find out a subquery was producing the below error:
Error Code: 1690. BIGINT UNSIGNED value is out of range in '(s
.subscriber_count
- (s
.subscribed_count
- s
.unsubscribed_count
))'
My data set looks like:
I came across https://stackoverflow.com/a/11780905/197606 and haven't actually tried it because I want to understand why this is producing this error. One comment mentions a negative expression, but there's no scenario in my situation where unsubscribed_count
is less than subscribed_count
.
Can anyone help me understand why I'm seeing this error?
SELECT * FROM table_name WHERE subscribed_count < unsubscribed_count ;
CREATE TABLE
statement, the actual query and the version of MySQL.