Skip to content

TRAILING

SELECT TRIM(TRAILING '0' FROM '9000');
'9'

The TRIM(TRAILING ... ) function in MySQL removes the trailing character that is specified in the parentheses. In the above example, it removes trailing ‘0’ from ‘9000’. The output becomes ‘9’ after removal of trailing zeros.