Combing two SQL Server tables together using a JOIN, and creating a Running Total

Опубликовано: 15 Июль 2022
на канале: SQL Server 101
5,224
38

I want to combine two tables together, and then create a running total. But how can I do this using a JOIN?
My SQL Server Udemy courses are:
70-461, 70-761 Querying Microsoft SQL Server with T-SQL: https://rebrand.ly/querying-microsoft...
98-364: Database Fundamentals (Microsoft SQL Server): https://rebrand.ly/database-fundamentals
70-462 SQL Server Database Administration (DBA): https://rebrand.ly/sql-server-dba
Microsoft SQL Server Reporting Services (SSRS): https://rebrand.ly/sql-server-ssrs
SQL Server Integration Services (SSIS): https://rebrand.ly/sql-server-ssis
SQL Server Analysis Services (SSAS): https://rebrand.ly/sql-server-ssas-mdx
Microsoft Power Pivot (Excel) and SSAS (Tabular DAX model): https://rebrand.ly/microsoft-powerpiv...
----
If you want to do this as a Practice Activity, then please used this code to start with.
DROP TABLE IF EXISTS Incoming;
DROP TABLE IF EXISTS Outgoing;

CREATE TABLE Incoming
(DateTransaction date,
Amount money);
CREATE TABLE Outgoing
(DateTransaction date,
Amount money);

INSERT Incoming VALUES
('2023-01-01', 50),
('2023-02-01', 100)
INSERT Outgoing VALUES
('2023-02-01', 30),
('2023-03-01', 25);

SELECT * FROM Incoming
SELECT * FROM Outgoing;

In this video, we'll create two tables, an Incoming and Outgoing table. We'll combine them using a JOIN, and then create a Running Total using a CTE and a Window function using OVER.


Смотрите видео Combing two SQL Server tables together using a JOIN, and creating a Running Total онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал SQL Server 101 15 Июль 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 5,224 раз и оно понравилось 38 посетителям.