Export to csv/excel way to include leading zero [duplicate]
问题 This question already has answers here : CSV for Excel, Including Both Leading Zeros and Commas (12 answers) Closed 6 years ago . 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, is there a way to preserve the leading zero while exporting to csv? 回答1: You need to wrap the number in double quotes like: ...,"04567",... , but then it will be