Editing
Export MySQL query to Excel file
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Troubleshooting of technical issues == === If it costs too much time to convert to Excel file === The important steps before generating CSV file. These steps reduce the problems when the CSV file was converted to Excel file. * Add '''delimiter character''' between different column ex: comma symbol (,) or tab symbol * Add '''enclosure character''' ex: double quote symbol (") or single quote symbol (') * Add '''escape character''' escape the column value if contains the '''enclosure character''' * Remove return symbol<ref>[http://stackoverflow.com/questions/1504962/how-to-remove-new-line-characters-from-data-rows-in-mysql trim - How to remove new line characters from data rows in mysql? - Stack Overflow]</ref>: <pre>SELECT REPLACE(REPLACE(REPLACE(`my_column`, '\r\n', ' '), '\n', ' '), '\r', ' ') </pre> === Data format in result set became string after exported as Excel file=== * '''Number''' data types in result set became '''string''' after exported as XLSX file <ref>[https://exceljet.net/formula/convert-text-to-numbers Excel formula: Convert text to numbers | Exceljet]</ref> * '''Date time''' data types in result set became '''string''' after exported as XLSX file<ref>[https://errerrors.blogspot.com/2016/12/excel-value-text.html Excel 如何轉換文字格式的日期時間格式 (使用 VALUE, TEXT 函數)]</ref>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information