--查询 select * from 表名; --表别名 select * from 表名 t; --表别名查询字段 select t.id from 表 t; --表别名查询条件 select * from 表 t where t.id = 2; --left join select * from 表1 t1 left join 表2 t2 on t1.id = t2.id; --表分组 --表union --warnig : 两张表,字段需要一样 select * from (select * from 表1 union select * from 表2); --表排序
原文:https://www.cnblogs.com/YaChing/p/10592859.html