Monday, August 8, 2011

VIEW in SQL.

In SQL, a view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table.

SQL CREATE VIEW Syntax


CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition


Example

CREATE VIEW [Current Product List] AS
SELECT ProductID,ProductName
FROM Products
WHERE Discontinued=No

0 comments:

Post a Comment