我找不到可以在查询中放置 WHERE 子句的位置。似乎我尝试了所有可能的位置,但没有任何效果。
SELECT res
FROM (
SELECT `date`,SUM(DISTRIBUTED_AMOUNT / EXCHANGE_RATE) AS res
FROM royalties
GROUP BY `date`
ORDER BY `date` DESC LIMIT 12
) a
ORDER BY `date` ASC
WHERE `BUNDLE_ARTIST` = '" . $artist_name . "'