Recursive CTE in sql server Part 51

preview_player
Показать описание
In this video we will learn about recursive common table expressions and the problems they solve. A CTE that references itself is called as recursive CTE.

Text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

Slides

All SQL Server Text Articles

All SQL Server Slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic
Рекомендации по теме
Комментарии
Автор

I've been a business/systems analyst for three years, and in that time I've consistently come back to this channel. Thanks again!

RandomAlexus
Автор

Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.

Csharp-video-tutorialsBlogspot
Автор

oh great and mighty Kudvenkat, we eternally thank you for sharing another piece of your infinite wisdom

kzev
Автор

It took me a minute to realize it but it's a lot simpler than it looks, getting into recursion theory will over complicate it. You're simply starting off with the big boss in the EmployeesCTE, then using his employeeid to match who has the same managerid in the employee table, that returns Mike and Tom and you increment the Level by 1. You now repeat the same process with Mike and Tom's employeeid

temprmj
Автор

THANK you for creating technical videos that do not move at a snail's pace. This must be the first technical video where I didn't have to put the video speed at 1.75 - 2x. Well done.

michaelgerety
Автор

One & only best video on recursive CTE's. Venkat ji, you rock!

sachin_yt
Автор

This is a great attempt to explain Recursive CTE's, but the self-join and heirarchy complicates things for the beginner. For those who are still confused, the 'Essential SQL' channel has a really simple breakdown...

The-Right-is-Right
Автор

My two cents for recursion, Step1 Super Boss is Add to EmployeeCTE, Step 2 TblEmployee with only Employee who had Super Boss as direct Manager are add to table with level 2 now Employee CTE has level 1 and 2, so recursively level 3, 4, .. will be added because there respective manager become available to them in EnployeeCTE

omaraissa
Автор

There could be no clear explanation than this, Keep making videos😉

Sunny-okdl
Автор

Your videos are so much helpful for us to learn🙏

nammozhi
Автор

why dislike? he is one of the best teachers

shabbarrizvi
Автор

Superb ! very well explained on recursive CTEs.

reddyabhik
Автор

recursive cte query is still unclear, how would it loop through, initially the cte will have one record that is the employee with level1 and then we are applying join on cte that has 1 record with table that has all the records, could you explain it to me please

LokeshSharma-wpxv
Автор

Thank you very much , you are the best learning for all technology. . go forward .

omymma
Автор

Thanks Venkat great videos because of these videos I learn

krishnanomula
Автор

Hi Mr.venkat your explanation is superb and thanks for sharing your knowledge.

roseroja
Автор

Honestly I feel the recursion part of this video is under-explained while he spent time more time on explaining simple operations which is more convenient to explain.

YT-yt-yt-
Автор

Thanks a lot! very good tutorials, useful and easy to understand

iirs
Автор

Hi Venkat,
Your Tutorials are awesome thanks for making these.
I think there is no need of last Join in the Query.Please look into Below Recursive CTE Query

With T1
As
(
Select EID,
Name,
MID,
cast('Super Boss' As varchar(50)) As Manager_Name, -- I am casting it to varchar(50) Because 'Name' Column in EMP table is varchar(50)
1 As Level
From Emp
Where MID is NULL

Union ALL

Select E.EID,
E.Name,
B.EID As MID,
B.Name As Manager_Name,
B.Level+1 as Level
From Emp E
inner join T1 B
On E.MID=B.EID
)
Select Name,
Manager_Name,
Level
From T1;

rahulphutela
Автор

Hi Sir, Happy teachers day....Can you please cover the recursive query part in more details...explaining the flow of the recursive query..thanks in advance

itsivanshi
visit shbcf.ru