我想這樣做選擇客戶誰特別放置順序一年
顯示誰已經下了訂單,1996年
所有客戶的客戶名稱,我使用的這個
的select
Customers.ContactName
from Customers
where
Customers.CustomerID = (
select Orders.CustomerID
from Orders
where year(Orders.OrderDate)=1996
);
但它給出了一個錯誤。
數據庫是羅斯文
你得到了什麼錯誤? – DevelopmentIsMyPassion 2013-03-03 20:24:29
錯誤可能是您從子查詢返回多行?使用'WHERE Customers.CustomID IN(select ....)'而不是'Customers.CustomerId =(select ...)' – 2013-03-03 20:24:53
yes Michael這是錯誤 – 2013-03-03 20:31:18