Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Common Table Expression

Language: Layout:
View schema
Execution time: 0,06 sec, rows selected: 38, rows affected: 22, absolute service time: 0,25 sec, absolute service time: 0,26 sec  
edit mode |  history  | discussion
   sql server version
1 Microsoft SQL Server 2014 - 12.0.2000.8 (Intel X86) Feb 20 2014 19:20:46 Copyright (c) Microsoft Corporation Express Edition on Windows NT 6.3 <X64> (Build 9600: ) (WOW64) (Hypervisor)
   ProductID ProductName ProductCategory ProductPrice
1 1 iPhone X Technology 1200
2 2 Nike Vapor Shoes Apparel 180
3 3 Ford Focus Automobile 18500
4 4 Nissan Altima Automobile 18500
5 5 Astros Cap Apparel 80
6 6 Barcelona Jersey Apparel 90
7 7 Samsung Galaxy Technology 850
8 8 Apple Watch Technology 320
   SellerID SellerName
1 1 Abi
2 2 Charlotte
3 3 Juliette
   SaleID ProductID_fk SellerID_fk
1 1 1 1
2 2 1 1
3 3 2 2
4 4 3 2
5 5 3 2
6 6 3 2
7 7 5 2
8 8 6 3
9 9 6 3
10 10 7 3
11 11 9 3
   SellerName ProductName ProductPrice
1 Abi iPhone X 1200
2 Abi iPhone X 1200
3 Charlotte Nike Vapor Shoes 180
4 Charlotte Ford Focus 18500
5 Charlotte Ford Focus 18500
6 Charlotte Ford Focus 18500
7 Charlotte Astros Cap 80
8 Juliette Barcelona Jersey 90
9 Juliette Barcelona Jersey 90
10 Juliette Samsung Galaxy 850
   SellerName TotalSalesPerSeller TotalNumberOfSales
1 Abi 2400 2
2 Charlotte 55760 5
3 Juliette 1030 3
   RowNumber SellerName TotalSalesPerSeller
1 1 Charlotte 55760
2 2 Juliette 1030