(一).WHERE 子句 (二).Hive ALL、DISTINCT、LIMIT子句 ALL和DISTINCT子句表示是否返回重复行,默认是ALL,返回所有匹配行 DISTINCT子句可以返回删除结果集中的重复行 LIMIT子句用于限制SELECT语句返回的行数 (三)嵌套查询 相关操作 ·内连接(inner join) select s.*,c.* from students s inner join class c on s.class_id=c.class_id; ·左外连接(left outer join) select s.*,c.* from students s left outer join class c on s.class_id=c.class_id; ·右外连接(right outer join) select s.*,c.* from students s right outer join class c on s.class_id=c.class_id; ·全连接(full outer join) select s.*,c.* from students s full outer join class c on s.class_id=c.class_id; ·左半连接(left semi join) select s.*,c.* from students s left semi join class c on s.class_id=c.class_id; ·交叉连接(cross join) 交叉连接的数据条数就是两个表的笛卡尔积(两表数据条数之积),交叉连接后的数据不存在配对关系,其sql甚至不需要指定连接规则。 select s.*,c.* from students s cross join class c;