mysql - How do I avoid a numeric data overflow -
i have query ran fine in our old mysql database there check:
where column_x + column_y > 524288000 now we've migrated redshift, query fails:
error: numeric data overflow (addition) detail: ----------------------------------------------- error: numeric data overflow (addition) code: 1058 context: query: 915381 location: numeric.hpp:112 process: query4_s0_22 [pid=6421] ----------------------------------------------- [sql state=xx000] both columns of type bigint. when running query without adding columns (just checking against 1 column or other) query executes fine. i'm assuming there rows column_x + column_y greater max size of bigint.
what's workaround here?
where column_x::numeric(20) + column_y::numeric(20) > 524288000
Comments
Post a Comment