Mysql 错误号:1241操作数应包含1列

Mysql 错误号:1241操作数应包含1列,mysql,Mysql,然后再选择返回*这是错误的 您应该使用exists SELECT * FROM `tbl_equipments` as `E` JOIN `tbl_equipment_category` as `C` ON `C`.`equipment_category_id`=`E`.`equipment_category_id` JOIN `tbl_suppliers` as `S` ON `S`.`supplier_id`=`E`.`supplier_id` JOIN `tbl

然后再选择返回*这是错误的

您应该使用exists

  SELECT * 
  FROM `tbl_equipments` as `E` 
  JOIN `tbl_equipment_category` as `C` ON `C`.`equipment_category_id`=`E`.`equipment_category_id` 
  JOIN `tbl_suppliers` as `S` ON `S`.`supplier_id`=`E`.`supplier_id` 
  JOIN `tbl_site_users` as `U` ON `U`.`user_id`=`E`.`created_by` 
  JOIN `tbl_currency` as `R` ON `R`.`currency_id`=`E`.`equipment_currency_id` 
  WHERE `E`.`site_id` = '3' 
  AND (SELECT * 
        FROM `tbl_user_delegates` as `D` 
        LEFT JOIN `tbl_equipments` as `E` ON `E`.`approve_by`=`D`.`delegate_from_user` 
        WHERE `D`.`delegate_from_date` <= '2016-10-27' 
        AND `D`.`delegate_to_date` >= '2016-10-27' AND `D`.`delegate_to_user` = '5' 
        ORDER BY `E`.`equipment_id` DESC) 
  AND (`E`.`approve_flg` =0 and `E`.`rejection_flg` =0) AND `E`.`approve_by` = '5'

而且,仅凭选择中的提示命令是无用的

您应该改进您的问题,并添加问题的解释。。标题中的错误消息和解释中的sql不好..很抱歉,我是堆栈溢出新手,请给出一些解决方案错误已解决,但子查询数据不存在如果我运行子查询,只有2个数据出现,但我运行完整查询子查询数据不存在如果错误已解决,则查询是正确的。。这意味着我的答案是正确的,你应该承认我的答案是正确的。。看看这里没有检索数据的事实如何与表中的数据相关。。。。确保您的数据或查询与预期结果匹配。。
  SELECT * 
  FROM `tbl_equipments` as `E` 
  JOIN `tbl_equipment_category` as `C` ON `C`.`equipment_category_id`=`E`.`equipment_category_id` 
  JOIN `tbl_suppliers` as `S` ON `S`.`supplier_id`=`E`.`supplier_id` 
  JOIN `tbl_site_users` as `U` ON `U`.`user_id`=`E`.`created_by` 
  JOIN `tbl_currency` as `R` ON `R`.`currency_id`=`E`.`equipment_currency_id` 
  WHERE `E`.`site_id` = '3' 
  AND  EXISTS (SELECT * 
        FROM `tbl_user_delegates` as `D` 
        LEFT JOIN `tbl_equipments` as `E` ON `E`.`approve_by`=`D`.`delegate_from_user` 
        WHERE `D`.`delegate_from_date` <= '2016-10-27' 
        AND `D`.`delegate_to_date` >= '2016-10-27' AND `D`.`delegate_to_user` = '5' 
        ORDER BY `E`.`equipment_id` DESC) 
  AND (`E`.`approve_flg` =0 and `E`.`rejection_flg` =0) AND `E`.`approve_by` = '5'