Create View SQL in SAP HANA database

SAP HANASAPSAP BasisSQL

>Create View View_name as
Select Col1,Col2 From Table_name;

In the above SQL statement, you are creating a view that contains Col1 and Col2 from the table.

Table Name − Emp_Info

Example

Id
EmplName
Empluser
Emplpassword
Joining_Date
1Employee 1
Emp1
Emp1Pwd
9/11/2016
2 Employee 2
Emp2
 Emp2Pwd  
 16/08/2015
3Employee 3
Emp3
Emp3Pwd
15/09/2016
4Employee 4
Emp4  
 Emp4Pwd  
3/07/2014
5Employee 5
Emp5
Emp5Pwd
10/09/2012
6Employee 6
Emp6
  Emp6Pwd  
 1/10/2013

                                                                                               

To create a view, which contains only 3 columns you have to write-

>Create View View_EmpInfo As
Select Id, EmplName,Joining_Date  From Emp_Info;

This view can be used by users to get Id, EmplName, and Joining_date.

 

raja
Published on 21-Feb-2018 19:38:54
Advertisements