SQL Server CREATE VIEW Statement

SQL Server CREATE VIEW Statement

In this post, You can add SQL functions, WHERE, and JOIN statements to a view and present the data as if the data were coming from one single table. A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database. A view is a virtual table based on the result-set of an SQL statement.

Syntax

CREATE VIEW view_name AS
SELECT column1, column2,column3, ......
FROM table_name
WHERE condition
CREATE VIEW [Test] AS
SELECT Name, Contact_Name
FROM Customer
WHERE Country = 'Delhi'

Example

SELECT * FROM [Test]

 

2020-03-29