JOIN
statement joins two tables ON
a defined column. It is a regular JOIN
used throughout SQL.
Name | Description |
---|---|
t1.column_name | Name of the column from the first table. |
t2.column_name | Name of the column from the second table. |
integration_name.table_name | Name of the table used in the JOIN operation. |
JOINs
MindsDB provides you with two categories of JOINs
. One is the JOIN
statement which combines the data table with the model table in order to fetch bulk predictions. Another is the regular JOIN
used throughout SQL. Please note that only the latter one requires the ON
clause.You can nest these types of JOINs
as follows:JOINs
work.
The pets
table that stores pets:
owners
table that stores pets’ owners:
JOIN
or INNER JOIN
JOIN
or INNER JOIN
command joins the rows of the owners
and pets
tables wherever there is a match. For example, a pet named Lake does not have an owner, so it’ll be left out.
WHERE
clause to filter the output data.
LEFT JOIN
LEFT JOIN
command joins the rows of two tables such that all rows from the left table, even the ones with no match, show up. Here, the left table is the owners
table.
RIGHT JOIN
RIGHT JOIN
command joins the rows of two tables such that all rows from the right table, even the ones with no match, show up. Here, the right table is the pets
table.
FULL JOIN
or FULL OUTER JOIN
FULL [OUTER] JOIN
command joins the rows of two tables such that all rows from both tables, even the ones with no match, show up.
animals
: