How to use JOIN USING in sql to simplify JOIN ON examples
Sep 08, 2017 pm 01:48 PMIn the join SQL statement in Mysql, the syntax format of the ON clause is: table1.column_name = table2.column_name.
When the schema design adopts the same naming style for the columns of the joined table, the USING syntax can be used to simplify the ON syntax, with the format: USING(column_name).
For example:
[sql] SELECT f.color, c.is_primary, c.is_dark, c.is_rainbow FROM flags f www.2cto.com INNER JOIN color c ON f.color = c.color WHERE f.country = 'China';
is equivalent to
[sql] SELECT f.color, c.is_primary, c.is_dark, c.is_rainbow FROM flags f INNER JOIN color c USING(color) WHERE f.country = 'China';
The above is the detailed content of How to use JOIN USING in sql to simplify JOIN ON examples. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What is the usage principle of MySQL Join?

What are mysql's join query and multiple query methods?

Convert numpy to list: an effective strategy to simplify data processing process

Use MySQL's JOIN function to join tables

Null Coalesce operator in PHP7: How to simplify the conditional judgment of the code?

How to optimize the join statement in MySQL
