zoukankan      html  css  js  c++  java
  • mysql数据导出excel格式+乱码解决

    1:导出的SQL命令,只需要加上“FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY ' ' ”

    select a.contact, a.text, b.nickname, b.create_time into outfile '/tmp/4.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '
    ' 
    from feedback a, user_3 b where a.text like '%XXX+%' and a.user_id = b.id and b.create_time >= '2016-03-28 00:00:00' and b.create_time < '2016-03-29 00:00:00';

    2:导出后的CSV打开是乱码,解决乱码问题

    3:用notepad打开,在格式里面选择utf8格式编码,保存。再打开就是正常了

  • 相关阅读:
    hdu 2227
    小A的数学题
    E
    F
    C
    Ping-Pong (Easy Version)的解析
    余数之和BZOJ1257
    大数求余
    数论学习 算法模板(质数,约数)
    Acwing 197. 阶乘分解
  • 原文地址:https://www.cnblogs.com/zuoxingyu/p/5337124.html
Copyright © 2011-2022 走看看