use Northwind 
go select dbo.Customers.CustomerID 
from dbo.Customers ,dbo.Orders
where  dbo.Orders.CustomerID=dbo.Customers.CustomerID 
go 

解决方案 »

  1.   

    select Customers.CustomerID
    from Customers,Orders
    where  Orders.CustomerID=Customers.CustomerID 
      

  2.   

    use Northwind 
    go select dbo.Customers.CustomerID 
    from dbo.Customers inner join dbo.Orders
    on  dbo.Orders.CustomerID=dbo.Customers.CustomerID 
    go 
      

  3.   

    where  dbo.Orders.CustomerID=dbo.Customers.CustomerID
    呵呵,你的 dbo.Customers表呢?
    可以用连接
    select dbo.Customers.CustomerID 
    from dbo.Customers inner join dbo.Orders
    on  dbo.Orders.CustomerID=dbo.Customers.CustomerID 也可以
    select Customers.CustomerID
    from Customers,Orders
    where  Orders.CustomerID=Customers.CustomerID 
      

  4.   

    use Northwind 
    go select dbo.Customers.CustomerID 
    from dbo.Customers 
    where  dbo.Orders.CustomerID=dbo.Customers.CustomerID 
    go dbo.Orders没有出现在from后面
    改为select dbo.Customers.CustomerID 
    from dbo.Customers ,dbo.Orders
    where  dbo.Orders.CustomerID=dbo.Customers.CustomerID