mysql (join query)

Use MySQL connection

You can use Mysql in SELECT, UPDATE, and DELETE statements JOIN jointly multi-table queries.

JOIN divided into the following three types according to the function:

  • INNER JOIN (the connection, or equivalent connection) : Get Records matching fields in the relationship between two tables. Conditions associated table on condition =
  • LEFT JOIN (left connection): Get the left table all records, even if no record corresponding to the right table matching.
  • RIGHT JOIN (right connecting):  with LEFT JOIN contrast, all records in the table for acquiring the right, the left table even if there is no corresponding matching records.
  • MySQL LEFT JOIN

    MySQL left join and join different. MySQL LEFT JOIN will read all the data in the data table on the left, the right table even if no corresponding data.

  • MySQL RIGHT JOIN

    MySQL RIGHT JOIN reads all the data of the data table on the right, on the left side of the table even if no corresponding data.

Guess you like

Origin www.cnblogs.com/wuyujun/p/11184477.html
Recommended