What is a Non-Equi Join in SQL and What is its Purpose? | Essential SQL

preview_player
Показать описание

Non-equi joins are joins whose join conditions use conditional operators other than equals.

An example would be where we are matching first name and then last name, but we are checking where one field from a table does not equal field from another table.

That's what makes it a non-equi join.

Even though in this join condition, we are matching column for column, first name in one table to first name in another, last name in one table to last name in another, we are making sure that the business entity ID in one table does not equal the business entity ID in another table.

Therefore, our join condition is considered a non-equi join. You may be wondering, why would we do this?

Well, there's a couple of reasons why we would want to use non-equi joins. Some of the common uses include:

- checking for duplicate data between tables
- matching against a range of values
- computing running totals.

In this video, we're going to go look at how you can check for duplicate data in a table. We're also going to look at how you can match against a range of values, and then we'll save the computing running totals example for the last lesson because that one's a little more advanced.
Рекомендации по теме
Комментарии
Автор

When using the non-equi join for looking for duplicated values the output will double the results? for instance if Kim Abercrombie is displayed 6 times in the output does that mean there are 3 Kim Abercrombie in the company/office?

lmeza