← All tables and views

Northwind view

Order Subtotals

Native view in the Northwind sample database.

830rows

2 columns

Schema from the provider contract
ColumnTypeNullableKeyReferences
OrderIDTEXTyes——
SubtotalTEXTyes——

View definition

CREATE VIEW [Order Subtotals] AS
SELECT [Order Details].OrderID, 
Sum(([Order Details].UnitPrice*Quantity*(1-Discount)/100)*100) AS Subtotal
FROM [Order Details]
GROUP BY [Order Details].OrderID

Data preview

Sample records

830 rows available
OrderIDSubtotal
10248440
102491863.4
102501552.6
10251654.06
102523597.9
102531444.8000000000002
10254556.62
102552490.5