gpt4 book ai didi

mysql - 我的 sql 查询中的操作数应包含 1 列

转载 作者:行者123 更新时间:2023-11-29 21:01:16 26 4
gpt4 key购买 nike

有人可以帮我解决这个问题吗?

    SELECT ((SELECT t6.`idreserva`, t5.`sala`, t6.`data`,t3.`inicio`, t4.`fim`, t6.`atividade`
FROM `req_reserva_detail` AS t1
INNER JOIN `req_material_tempo` AS t3 ON (t1.`idtempoInicio` = t3.`idtempo`)
INNER JOIN `req_material_tempo` AS t4 ON (t1.`idtempoFim` = t4.`idtempo`)
INNER JOIN `req_material_sala` AS t5 ON (t1.`idsala` = t5.`idsala`)
INNER JOIN `req_reservas` AS t6 ON (t1.`idreserva` = t6.`idreserva`)
INNER JOIN `utilizador` AS t7 ON (t6.`idutilizador` = t7.`idutilizador`) WHERE t6.`idutilizador` = 670 AND t6.`data` >= CURDATE() ORDER BY DATA ASC),
(SELECT nome FROM `req_reserva_detail` AS t1, `req_material_equipamento` AS t2 WHERE t1.`idequipamento` = t2.`idequipamento` GROUP BY nome))

它给出了这个错误,但我不知道如何解决这个问题......

问候

更新

架构

enter image description here

最佳答案

(SELECT t6. idreserva,
t5. sala,
t6. data,
t3. inicio,
t4. fim,
t6. atividade
FROM req_reserva_detail AS t1
INNER JOIN req_material_tempo AS t3
ON (t1. idtempoInicio = t3. idtempo)
INNER JOIN req_material_tempo AS t4
ON (t1. idtempoFim = t4. idtempo)
INNER JOIN req_material_sala AS t5
ON (t1. idsala = t5. idsala)
INNER JOIN req_reservas AS t6
ON (t1. idreserva = t6. idreserva)
INNER JOIN utilizador AS t7
ON (t6. idutilizador = t7. idutilizador)
WHERE t6. idutilizador = 670
AND t6. data >= CURDATE()
ORDER BY DATA ASC)

您的这个子查询返回 5 列,但这是用作子查询,并且 mySQL 期望它仅返回一列

关于mysql - 我的 sql 查询中的操作数应包含 1 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37206808/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com