-6
要在ADO.Net中運行的SQL命令字符串。它可能在子查詢中返回了多於一行的問題。子查詢在sqlc中返回了超過1個值#
string str = "
select
(select (quantity) from Orderinfo where iron=1 and rno=o.rno) as iron
,(select (quantity) from Orderinfo where wash=1 and rno=o.rno) as wash
,(select (quantity) from Orderinfo where dryclean=1 and rno=o.rno) as dryclean
,o.rno
,o.id
,o.name
,(select sum(convert(int,d.quantity)) from orderinfo as d where d.rno=o.rno) as quantity
,o.status
from orderinfo as o
where o.status='Order in Process'
group by o.rno,o.id ,o.status ,o.name";
改爲使用select top 1 .......。 –
請小心處理您的SQL查詢,它們應該像應用程序代碼一樣可讀,可維護且清晰。 – Arran