2016-12-11 57 views
0

我創造了這個觀點被稱爲[供應商名單]需要創建一個查詢,將調用此供應商清單幫助是爲CREATE VIEW代碼:如何創建一個查詢,將調用您的視圖

CREATE VIEW [Vendors List] 
AS 
    SELECT 
     VendorID, 
     SUM(InvoiceTotal) AS [YTD Invoice Total], 
     SUM(PaymentTotal) AS [YTD Payment Total], 
     SUM(CreditTotal) AS [YTD Credit Total] 
    FROM 
     dbo.Invoices 
    GROUP BY 
     VendorID 
+0

創建查詢什麼?你想用這個查詢做什麼? – Anand

+1

這是SQL服務器,而不是mysql – e4c5

+0

對不起,我想說的是我必須創建一個查詢,可以調用我上面創建的視圖,顯示上面查詢中的所有列 –

回答

1

我可以「相信你創建的視圖根據您的問題,但在這裏你去:

select * from [Vendors List] 
0

SELECT * FROM [」供應商目錄']

+0

這是一個錯誤的答案 –