選擇代碼我在SQL Server 2005中使用此代碼,它的工作原理。SQL Server 2000其中代碼=從
select name
from customers
where code = (select code from inventory where Active = 1)
如何在SQL Server 2000中執行此操作?
選擇代碼我在SQL Server 2005中使用此代碼,它的工作原理。SQL Server 2000其中代碼=從
select name
from customers
where code = (select code from inventory where Active = 1)
如何在SQL Server 2000中執行此操作?
使用IN ..With =如果有一個以上的代碼,您的查詢就會失敗
select name from customers where code in (select code from inventory where Active=1)
如果只返回一個代碼,Doesnt'=(SELECT code ...)'在sql-server 2000中工作嗎? –
是的,只要返回一個代碼就可以工作 – TheGameiswar
@TimSchmelter,可能是數據相關問題,與所使用的SQL Server版本無關。 – jarlh
如果只有一個返回代碼,應該工作 –
你得到什麼錯誤? –
我不知道什麼是更好的,你的方法或內部聯接:'從客戶選擇c.name內部聯合庫存我在i.code = c.code其中i.active = 1'。 –