编程语言
首页 > 编程语言> > php-#1241-操作数应包含1列

php-#1241-操作数应包含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)

有任何想法吗 ?

解决方法:

用单个列替换* li

标签:php,mysql,mysql-error-1241
来源: https://codeday.me/bug/20191012/1901046.html