我有这个查询,我想选择该选择的倒数。
SELECT Guide.id FROM Guide
INNER JOIN GuideAvailability ON Guide.id = GuideAvailability.guideId
WHERE GuideAvailability.startDate IN (1377946800)
GROUP BY GuideAvailability.guideId
HAVING COUNT(DISTINCT GuideAvailability.id) = 1
有没有简单的方法来解决我的问题?