Return Matched and Unmatched Records with Intersect and Except Operator in SQL Server

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024
  • One of the most common data analysis tasks I have seen is trying to figure out matched and unmatched records from 2 tables. So in this SQL Server tutorial, we will learn how to use INTERSECT and EXCEPT operators to perform such task.
    📖 More information on INTERSECT and EXCEPT: docs.microsoft...
    ► Buy Me a Coffee? Your support is much appreciated!
    -------------------------------------------------------------------------------------------
    ☕ Paypal: www.paypal.me/...
    ☕ Venmo: @Jie-Jenn
    💸 Join Robinhood with my link and we'll both get a free stock: bit.ly/3iWr7LC
    ► Support my channel so I can continue making free contents
    ---------------------------------------------------------------------------------------------------------------
    🌳 Becoming a Patreon supporter: / jiejenn
    🛒 By shopping on Amazon → amzn.to/2JkGeMD
    📘 Facebook Page → / madeinpython
    📘 More tutorial videos on my website → LearnDataAnaly...
    👩‍💻 Follow me on Linked: / jiejenn
    ✉️ Business Inquiring: RUclips@LearnDataAnalysis.org
    #SQLServer #MSSQLServer

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

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

    Hey! Sorry for asking but I'm wondering if you found out how to delete all videos on a channel using RUclips API?

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

    Can you use EXCEPT to pick up on data variance within the columns if you have say 20 columns

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

      You can, but then you will have to manually specify the conditions, which is a lot of typing.

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

      @@jiejenn great..thank you!

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

    Is using INTERSECT and EXCEPT more efficient than using EXISTS and NOT EXISTS ?

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

      Performance wise, I think INTERSECT and EXCEPT to be more efficient as the operation is doing a straight comparison between two tables vs EXISTS evaluates each records. But the biggest difference is INTERSECT and EXCEPT will eliminate duplicate records and EXISTS don't.

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

      @@jiejenn Thanks for the clarification. I think using DISTINCT would alleviate duplicate records; however, INTERCEPT and EXCEPT are more straightforward to code.

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

    Database automation by using python