Mysql concatenation operator bitsCN.com
Mysql join operator
1. the effect of the comma-separated JOIN operator is similar to that of inner join:
[SQL]
Select t1. *, t2. * from t1, t2 where t1. I = t2. I;
It is equivalent:
[SQL]
Select t1. *, t2. * from t1 inner join t2 where t1. I = t2. I;
Note that the priority of the comma-separated join operator is different from that of other join types, which sometimes leads to syntax errors, while other join operators do not. Avoid using the comma operator whenever possible.
2. using () clause: it is similar in concept to the on clause and where, but requires that the joined column be of the same name.
For example:
[SQL]
Select t1. *, t2. * from t1 inner join t2 using (I );
It is equivalent:
[Html]
Select t1. *, t2. * from t1 inner join t2 on t1. I = t2. I;
3. how to eliminate auto-join (that is, connecting a data table with itself ).
Aliases are used at this time, for example:
[SQL]
Select m1.name, m2.name from mytable as m1 inner join mytable as m2 where m1.name = m2.name
4. left join and right join (outer join)
The inner join can only display data rows that can be found in two data tables. In addition to displaying the same results, the outer join can also display matching data rows in one data table. The left join operation also displays the rows that do not match the Left Data table in the right data table. Data not found in the right table is NULL.
BitsCN.com