在链接mysql服务器中查询

qni6mghb  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(314)

嗨,我已经将我的mysql服务器(172.xx.xx.xx)链接到我的sql server。但是在使用查询时,它提供了错误。

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

此查询工作正常,但在通过error:-

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');

如何解决链接服务器中的查询问题。
这就是错误
字符串“”后的引号未闭合)

iszxjhcz

iszxjhcz1#

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

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'')');

相关问题