1. Where statement
Query the list of English scores greater than or equal to 70:
Select Name,ceil (Salary) as salary,age from employees where score[' 中文版 ']>=70;
Output Result:
Name Salary Age
WANGWU1 5500 20
WANGWU3 8400 20
Wangwu4 8400 20
Use the like statement to blur the view of list information
Select Name,ceil (Salary) as salary,age,address.province from employees where address.province like ' river% ';
Output Result:
Name Salary Age Province
Wangwu3 8400 20 Hebei
Wangwu4 8400 20 Hebei
Queries that contain "state" or "high monument" keywords are queried by the like statement and the Rlike statement, two scenarios:
SELECT * FROM employees where address.street like '% State% ' OR address.street like '% High Monument% '
SELECT * FROM Employees where Address.street rlike '. * (State | High monument). * ';
It is also possible to plan Rlike support Java-like regular expressions through the above scheme, which is the extension of Hive 2. GROUP by Statement
The statement is typically used with aggregate functions, grouped by one or more queued results, and then an aggregate function is executed for each grouping.
After the group by group is completed, the group is then filtered by the having to conditionally filter the results after grouping.