Filtering data with conditions

It is quite common to narrow down the result set by using a condition clause, such as LIMIT, WHERE, IN/NOT IN, and EXISTS/NOT EXISTSThe LIMIT keyword limits the specified number of rows returned randomly. Compared with LIMIT, WHERE is a more powerful and generic condition clause to limit the returned result set by expressions, functions, and nested queries as in the following examples:

> SELECT name FROM employee LIMIT 2;+----------+|   name   |+----------+| Lucy     || Michael  |+----------+2 rows selected (71.125 seconds)  > SELECT name, work_place FROM employee WHERE name = 'Michael'; +----------+------------------------+ | name     | work_place             | +----------+------------------------+ | Michael | ["Montreal","Toronto"] ...

Get Apache Hive Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.