gpt4 book ai didi

mysql - 在链接的Mysql服务器中查询

转载 作者:行者123 更新时间:2023-11-29 17:25:42 25 4
gpt4 key购买 nike

您好,我已将 MYSQL 服务器 (172.xx.xx.xx) 链接到我的 sql 服务器。但在使用查询时它提供了错误。

select * from OPENQUERY ([MYSQL],'select * from example.address_table limit 10')

此查询工作正常,但在执行以下查询时出现错误:-

select * from OPENQUERY ([MYSQL],'select * from example.address_table
where (create_date between '2015-01-01 00:00:00' and '2015-01-31 23:59:59') or
(modified_date between '2015-01-01 00:00:00' and '2015-01-31 23:59:59');

如何解决链接服务器中的查询。

这是错误

Unclosed quotation mark after the character string ')

最佳答案

鉴于您的错误,这应该是修复

select * from OPENQUERY ([MYSQL],'select * from example.address_table 
where (create_date between ''2015-01-01 00:00:00'' and ''2015-01-31 23:59:59'') or
(modified_date between ''2015-01-01 00:00:00'' and ''2015-01-31 23:59:59'')');

关于mysql - 在链接的Mysql服务器中查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50986913/

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