您好我有一個MySQL查詢獲取了許多的id(studentID)的,下面MySQL錯誤:子查詢返回多個1行
select t1.studentID
from remittedfees t1
where (select t2.fees
from feesasigned t2
where t2.studentID=t1.studentID) = (select sum(t3.remittedAmt)
from remittedfees t3
where t3.studentID = t1.studentID);
給出,但該查詢返回以下錯誤
ERROR 1242 (21000): Subquery returns more than 1 row
如何重寫查詢以獲得結果?
你想要檢索的字段是什麼? – 2012-03-15 05:24:18
請使用數據添加關於您的表格結構的更多信息。 – 2012-03-15 05:25:10