摘要:
内连接 jion on 自连接 本表进行内连接的查询形式 外链接: 左链接 写法:select 字段 from 表1 t left join 表2 s on t.字段1 = s.字段1 where 条件 或者 作用:保证左边的表的数据全部显示,包括空的 右链接 写法 :selec 字段 from 表 阅读全文
摘要:
join on多表之间的关联查询 写法select 字段 from 表1 t join 表2 s on t.字段1 = s.字段1 where 条件; 也可以这么写select 字段 from 表1 t, 表2 s where t.字段1 = s.字段1; 特点表的数据和另外一个表没有可关联数据,那 阅读全文
摘要:
分组group by写法 select 字段名 from 表名 group by 字段名 查询这个字段名里的种类分组后可以加聚合函数select 字段名,聚合函数 from 表名 group by 字段名 查询分组后每个的值加条件having 条件语句,不能使用别名 写在group by 字段名 后 阅读全文