Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有以下查询:
insert into myTable values ("TEST 1 TEST 2")
然后我选择要输出到 Excel 工作表的描述:
select description from myTable
结果:
说明 测试 1测试 2
这将导致单行描述列的输出在 .xls 输出中拆分为 2 行。
我该如何解决这个问题,以便将整个字符串放在 1 行上。
我们可以循环它并找到回车并替换它吗?或者?
谢谢你。
使用“替换”子句,您可以执行以下操作:
select replace(replace(description,chr(10),' '),chr(13),' ') from myTable
chr(10)
chr(13)