创建视图的SQL代码5
发布网友
发布时间:2023-10-29 01:23
我来回答
共2个回答
热心网友
时间:2024-11-07 16:37
额
创建视图
CREATE VIEW VTest_A
AS
SELECT 'Hello-World' AS A
查询视图
SELECT * FROM VTest_A
热心网友
时间:2024-11-07 16:37
下面为从一销售表中统计每个客户的购买总数、和总重量的视图,供参考。
CREATE VIEW dbo.VIEW1
AS
SELECT guestid, COUNT(barcode) AS Expr2, SUM(suttleb) AS Expr1
FROM dbo.sales
GROUP BY guestid