Exporting select query data from mysql to csv & opening with excel, the leading zeros are gone.
Although the column is varchar, when the data gets exported, it writes like
4567 instead of 04567,
You need to wrap the number in double quotes like:
...,"04567",..., but then it will be interpreted as text in the spreadsheet so integer arithmetic will not work on it unless you do a conversion first (integers cannot begin with 0 in excel).