参考:http://eric-gcm.iteye.com/blog/1807468 例子1: 概要:数据去重 描述:将file1.txt.file2.txt中的数据合并到一个文件中的同时去掉重复的内容 file1: 2012-3-1 a 2012-3-2 b 2012-3-3 c 2012-3-4 d 2012-3-5 a 2012-3-6 b 2012-3-7 c 2012-3-3 c file2: 2012-3-1 b 2012-3-2 a 2012-3-3 b 2012-3-4 d 201…
一.内连接 —— INNER JOIN 内连接是最常见的一种连接,只连接匹配的行. 表1: 表2: 执行查询: select StudentId as 学生编号,StudentName as 姓名,Gender as 性别,Likes as 爱好,ClassName as 所在班级 from Students a inner join Class b on a.ClassID = b.ClassId 效果: 二.外连接 —— LEFT JOIN 返回左表的全部行和右表满足ON条件的行,如果左表的…