如果我的内连接没有返回任何内容,如何忽略第二个WHERE子句?
SELECT MAX( DATE ) , URL
FROM History
WHERE UID = '$uid'
AND DATE < ( SELECT MAX( DATE ) FROM History WHERE URL = '$url' AND UID = '$uid' )
GROUP BY URL
ORDER BY DATE DESC
LIMIT 1
基本上,如果我的内部联接不返回任何查询应该是:
SELECT MAX( DATE ) , URL
FROM History
WHERE UID = '$uid'
GROUP BY URL
ORDER BY DATE DESC
LIMIT 1