Our Most Power Query Yet! Recursive CTE's (Common Table Expressions) | Essential SQL

Поделиться
HTML-код
  • Опубликовано: 9 дек 2020
  • If you're having troubles understanding how SQL recursive common table expressions work, then you'll want to watch this video. Learn more about SQL CTE's at www.essentialsql.com/introduc...
    Recursive CTE's are useful for solving problems involving hierarchies such as manufacturing bill of materials or organizational charts.
    Before you can dig into those complex queries let me help you make sure you got the basics down.
    Most Business Analysts don’t know where to start learning SQL. At Essential SQL we have an easy-to-understand plan. You learn SQL frustration free, at the right time in the right order. Enroll today: www.essentialsql.com/landing/...

Комментарии • 21

  • @AbdulSamad-xe2xe
    @AbdulSamad-xe2xe 3 года назад +13

    Probably the most simplified explanation of recursive CTE,
    Thanks a lot sir, keep the good work n stay safe.

  • @theoemanuelsson7576
    @theoemanuelsson7576 Месяц назад

    Great video, thank you!

  • @singhshobhit11
    @singhshobhit11 2 года назад +1

    I had no clue about RCTEs even after various tutorials but you really simplified it for me. Thanks a lot.

    • @EssentialSQL
      @EssentialSQL  2 года назад

      My pleasure! I’m glad the video made it easier for you to understand recursive CTE’s

  • @juliawenkmann8510
    @juliawenkmann8510 3 года назад +2

    Thank you, you're great! You helped me a lot! I finally got it!

  • @wennwenn1422
    @wennwenn1422 10 месяцев назад +1

    How are recursive ctes evaluated? I was hoping for step by step approach. What does union all have to do with anything? Shouldn't anchor statement be called multiple times when recursive statement is called?

  • @sujathapullareddy7726
    @sujathapullareddy7726 8 месяцев назад

    Thank you, very helpful.

  • @michaelkoss
    @michaelkoss 4 месяца назад +1

    Late to the party, but...
    In your first example, your termination clause was "n < 10" and yet, you got 10 in your results. Can you explain why that is?
    Fantastic video! Thank you so much. This really helped me understand (except the termination clause lol)

    • @goforchuck
      @goforchuck 4 месяца назад +1

      I think it's because when it gets to the 9th iteration, 9 is still less than 10 and the query is selecting 9 + 1 for that iteration. The results include 1 because 1 is the "seed" value that is also being selected with the first select statement.

  • @MrTokoFire
    @MrTokoFire 9 месяцев назад

    Thanks for the video! How would you introduce a recursive starting at 0 and going by .125?

  • @calvinbutler5517
    @calvinbutler5517 Год назад

    That was extremely helpful. Thank you much!

  • @vamsireddy5051
    @vamsireddy5051 11 месяцев назад

    Great video, really helpful, Thanks 👍

  • @NIN1
    @NIN1 Год назад +2

    If using MySQL the syntax is
    WITH RECURSIVE

    • @EssentialSQL
      @EssentialSQL  Год назад +1

      That for pointing that out! I find it interesting how each "dialect" is slightly different.

    • @NIN1
      @NIN1 Год назад

      @@EssentialSQL thank you so much for the video!