SQL JOIN and different types of JOINs

后端 未结 6 1016
[愿得一人]
[愿得一人] 2020-11-21 05:39

What is a SQL JOIN and what are different types?

6条回答
  •  心在旅途
    2020-11-21 06:01

    I'm going to push my pet peeve: the USING keyword.

    If both tables on both sides of the JOIN have their foreign keys properly named (ie, same name, not just "id) then this can be used:

    SELECT ...
    FROM customers JOIN orders USING (customer_id)
    

    I find this very practical, readable, and not used often enough.

提交回复
热议问题