在以下查询中,我尝试为每个类别获取一张图片
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)
有任何想法吗 ?