简体   繁体   中英

I want to join two tables in my database

I search in internet but i want some more sufficient answer. when i join a full of rows table in my database with an empty table from the same database. All the rows, from the full of rows table, will create also in the empty table?? That is the purpose of a join two tables?

if you want to display either one of the table even if the other table is empty, then use left or right join .

INNER JOIN

This is the simplest, most understood Join and is the most common. This query will return all of the records in the left table (table A) that have a matching record in the right table (table B)

LEFT JOIN

This query will return all of the records in the left table (table A) regardless if any of those records have a match in the right table (table B). It will also return any matching records from the right table.

RIGHT JOIN

This query will return all of the records in the right table (table B) regardless if any of those records have a match in the left table (table A). It will also return any matching records from the left table

Here's the complete guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM