How can I remove zeros (not just leading zeros, but zeros in every position) from a column containing Integers(numbers)?
For example : 0349010330 should become 349133
In case you want to remove the same numbers of zeros from the end, you can apply a formula to solve it. Select the adjacent cell to the number you used. Type this formula =LEFT(D1, LEN(D4)-2)*1, D4 is the cell you will remove trailing zeros from, 2 is the number of zeros you want to remove.
Use the lstrip() Function Along With List Comprehension to Remove Leading Zeros in a String in Python. The lstrip() can be utilized to remove the leading characters of the string if they exist. By default, a space is the leading character to remove in the string.
Here is the solution (MySQL) for Hackerrank challenge The Blunder
SELECT CEIL((AVG(salary)) - (AVG(REPLACE(salary, '0', '')))) AS avg_salary FROM employees;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With