请问下sqlserver的查询在access怎么写,如下:
SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued,
(SELECT CategoryName FROM Categories WHERE Categories.CategoryID = Products.CategoryID) as CategoryName, (SELECT CompanyName FROM Suppliers WHERE Suppliers.SupplierID = Products.SupplierID) as SupplierName
FROM Products WHERE (CategoryID = @CategoryID)
------解决方案--------------------------------------------------------
把@CategoryID换成?号就可以了,其他的跟sql一样
附:我是在MSDN上看到MS这么写的,自己没试过