1、left join,left outer join
以第一个表为主表,进行合并查询结果集,没有关联值的设置为NULL字符
2、right join,right outer join
以第二个表为主表,没有关联值的设置字符NULL
3、join,inner join
讲两个表或结果集合并,过滤掉值不存在的
4、union,union all
连接两张表或两个查询结果集。union过滤掉重复的,union all 全部返回
5、using
类似两表关联的查询条件例如using(id)等价于join on a.id=b.id
6、between and
类似于范围查询如:where between 3 and 9等价于 where id>=3 and id <=9
7、like "%*%"
模糊匹配查询,一般和limit一起使用,在进行前置字符模糊匹配的时候不能使用索引。如:like "%zhang"
8、in
等值查询,如:where id in(3,4,5)等价于where id=3 or id=4 or id=5
9、on
和join一起使用,是关联查询的条件,如:join **** on a.id=b.id或join **** on in(id)