gpt4 book ai didi

SQl 输出到 CSV(不带单引号)

转载 作者:行者123 更新时间:2023-12-02 21:51:47 30 4
gpt4 key购买 nike

我正在 Adaptive Server Anywhere v7 上运行查询。

select customerinfo.customerid, Name, Address1, Address2, City, State, ZIP, Country from customerinfo, addressinfo
where customerinfo.customerid = addressinfo.customerid
and MEMBER = (Date(GetDate()-4))
and addressinfo.addresstype = 's';
Output to C:\SamplePacks.CSV

输出是:

123, '姓名','地址1,'地址2'......

有没有办法运行查询以使单引号不显示?

最佳答案

参见doc

QUOTE clause The QUOTE clause is for the TEXT output format only. The quote string is placed around string values. The default is a single quote ('). If ALL is specified in the QUOTE clause, the quote string is placed around all values, not just around strings. To suppress quoting, specify empty single quotes. For example, QUOTE ''.

看来你应该这样做

Output to 'C:\SamplePacks.CSV' QUOTE ''

关于SQl 输出到 CSV(不带单引号),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18494738/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com