次のクエリでは、カテゴリごとに 1 つの画像を取得しようとしています
SELECT l.*
FROM (
SELECT id AS category_id,
COALESCE(
(
SELECT *
FROM images li
WHERE li.category_id = dlo.id
ORDER BY
li.save_status DESC, li.category_id DESC, li.id DESC
LIMIT 1
), 0) AS mid
FROM cats_imgs dlo where id='1'
) lo
JOIN images l
ON l.save_status = '3'
AND l.category_id >= lo.category_id
AND l.category_id <= lo.category_id
AND l.id >= lo.mid
しかし、次のエラーが発生し続けます:
#1241 - Operand should contain 1 column(s)
何か案は ?