我的查询有什么问题?:(
USE tempdb;
IF OBJECT_ID('dbo.OrderTotals', 'V') IS NOT NULL
DROP VIEW dbo.OrderTotals;
IF OBJECT_ID('dbo.OrderDetails', 'U') IS NOT NULL
DROP TABLE dbo.OrderDetails;
GO
CREATE TABLE dbo.OrderDetails
(
oid INT NOT NULL,
pid INT NOT NULL,
qty INT NOT NULL,
PRIMARY KEY(oid, pid)
);
INSERT INTO dbo.OrderDetails(oid, pid, qty) VALUES
(10248, 1, 10),
(10248, 2, 20),
(10248, 3, 30),
(10249, 1, 5),
(10249, 2, 10),
(10249, 3, 15),
(10250, 1, 20),
(10250, 2, 20),
(10250, 3, 20);
GO
如果我执行该查询,我会收到此错误
消息 102,级别 15,状态 1,第 2 行 ',' 附近的语法不正确。