Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




HIVE SELECT Statement

The SELECT statement is used to fetch data from a HIVE table.


Syntax:


SELECT column1,column2,...,columnN from <tablename>;


column1,column2 are the columns of the table./p>


SELECT * from <tablename>;


The '*' is used to select all the fields from the table



Example:

SELECT emp_id,city from Employee;

emp_id city
101 California
102 Mumbai
103 Delhi
104 Bangalore
105 Delhi

Selects only emp_id and city.


SELECT * from Employee;

emp_id name city salary
101 John California 50000
102 Tom Mumbai 40000
103 Harry Delhi 80000
104 Rahul Bangalore 60000
105 Sakil Delhi 90000

Selects all the values from Employee table.