摘要: 一、内连接 inner join:只取两张表的共同部分 select * from employee inner join department on employee.dep_id = department.id; 二、左连接 left join:在内连接的基础上保留左表的记录 select * 阅读全文
posted @ 2020-02-15 16:02 南啾 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 单表查询 select distinct 字段1,字段2,字段3 from 库.表 where 条件 group by 分组条件 having 过滤条件 order by 排序 limit n; # distinct 去重 # limit 显示条数# 执行顺序:先执行from查找表,再执行where 阅读全文
posted @ 2020-02-15 00:51 南啾 阅读(181) 评论(0) 推荐(0) 编辑