- Big Data Analytics with Hadoop 3
- Sridhar Alla
- 213字
- 2021-06-25 21:26:11
WHERE clauses
A WHERE clause is used to filter the result set by using predicate operators and logical operators with the help of the following:
- List of predicate operators
- List of logical operators
- List of functions
Here is an example of using the WHERE clause:
select * from OnlineRetail where Description='WHITE METAL LANTERN' limit 5;
The following is the hive console showing the query execution:

The following query shows us how to use the group by clause:
select Description, count(*) from OnlineRetail group by Description limit 5;
The following is the hive console showing the query execution:

The following query is an example of using the group by clause and specify conditions to filter the results obtained with the help of the having clause:
select Description, count(*) as cnt from OnlineRetail group by Description having cnt> 100 limit 5;
The following is the hive console showing the query execution:

The following query is another example of using the group by clause, filtering the result with the having clause and sorting our result using the order by clause, here using DESC:
select Description, count(*) as cnt from OnlineRetail group by Description having cnt> 100 order by cnt DESC limit 5;
The following is the hive console showing the query execution:

- Oracle SOA Governance 11g Implementation
- LabVIEW虛擬儀器從入門到測控應用130例
- Mastercam 2017數控加工自動編程經典實例(第4版)
- 程序設計語言與編譯
- 自動檢測與傳感技術
- Maya 2012從入門到精通
- JavaScript典型應用與最佳實踐
- 我也能做CTO之程序員職業規劃
- Dreamweaver CS6精彩網頁制作與網站建設
- Bayesian Analysis with Python
- Microsoft Dynamics CRM 2013 Marketing Automation
- 無人駕駛感知智能
- 伺服與運動控制系統設計
- 傳感技術基礎與技能實訓
- Java求職寶典