Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can we create view like following query

create view vChitta ;

Why wegive select statement reference
Posted

1 solution

Hi,

While Creating view you need to specify the Details through SELECT Statement,Without SELECT Statement you can't Create VIEW.

SQL
CREATE
[OR REPLACE]
[ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
[DEFINER = { user | CURRENT_USER }]
[SQL SECURITY { DEFINER | INVOKER }]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]


In View Creation select_statement is mandatory. So "SELECT" Statement is Must.

Read the following links for VIEWs.

CREATE VIEW Syntax[^]

SQL Views[^]

Views[^]

Different Types of SQL Server Views[^]

Regards,
GVPrabu
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900