puyangsky

使用sql语句导出需要的数据,sql语句不限于单个表的查询。由于我的数据库编码是utf8格式,而office默认的编码则是gb2312,所以当某个字段中包含中文时,导出到excel后,中文内容是会乱码的,此时需要convert转换编码,具体使用方式:

select id,scope,target_name,target_memo,convert(description using gb2312),major_unit,last_major_unit,grayscale_unit,status,delete_by,log_mode into outfile \'/Users/puyangsky/Desktop/t.xls\' from t_crontab;

分类:

技术点:

相关文章:

  • 2021-08-28
  • 2021-09-18
  • 2022-01-08
  • 2021-10-07
  • 2022-02-16
  • 2021-06-04
  • 2021-08-19
  • 2021-08-26
猜你喜欢
  • 2021-11-28
  • 2021-11-28
  • 2021-11-18
  • 2022-12-23
  • 2021-09-14
  • 2021-11-14
  • 2021-11-19
相关资源
相似解决方案