当我在本地PC上的代码中对此问题进行故障排除时,我有一个查询可以正常运行,但是它可以正常工作,但是当我将它放在实时服务器上时,我认为查询由于某种原因而失败,但是我不是当然,这可以归结为日期字段,但是老实说,我不知道为什么它在服务器上失败了。我已经尝试过SQL函数Date,date_to_string,并且我的日期格式为“ 2019-03-08”,请提供帮助,我的查询如下。
select posted_ads.id, posted_ads.title,
posted_ads.description, posted_ads.price,
posted_ads.datePosted,
posted_ads.adCategory,
posted_ads.adSuspended, posted_ads.suspensionEmailSent,
posted_ads.adSuspensionReason, posted_ads_images.id, posted_ads_images.imageName,
posted_ads_images.type, posted_ads_images.adID
from posted_ads inner join
posted_ads_images
on posted_ads.id = posted_ads_images.adID
where title like '%mechanic%' and
posted_ads.adExpired = 0 and
posted_ads.datePosted between '2018-12-09' and '2019-03-09'
group by posted_ads.id
limit 6 offset 6