Long story short: I need to find the rules for type conversion from string to integer in MariaDB.
My case: I have a VARCHAR column in a table that can have numeric values (1
,2
,3
), numeric values padded with zeroes (01
, 02
, 03
) and some non numeric values. I need to compare the numeric values as integers, but can't find sufficient documentation about the workings of CAST or CONVERT functions. It is not at all obvious to me that for example non numeric values should be always converted to 0 as it now seems to work.