Can SELECT Statements Be Used on Views in MS SQL Server?
Submitted by: AdministratorSelect (query) statements can be used on views in the same way as tables. The following tutorial exercise helps you creating a view and running a query statement on the view:
<pre>
CREATE VIEW myLinks AS SELECT * FROM ggl_links
WHERE url LIKE '%glo%'
GO
SELECT tag, counts, url, created
FROM myLinks ORDER BY counts DESC
GO
tag counts url created
DBA 972 globalguideline.com 2007-05-19
SQA 728 globalguideline.com/html 2007-05-19
DEV 120 globalguideline.com/sql 2006-04-30
</pre>
Submitted by: Administrator
<pre>
CREATE VIEW myLinks AS SELECT * FROM ggl_links
WHERE url LIKE '%glo%'
GO
SELECT tag, counts, url, created
FROM myLinks ORDER BY counts DESC
GO
tag counts url created
DBA 972 globalguideline.com 2007-05-19
SQA 728 globalguideline.com/html 2007-05-19
DEV 120 globalguideline.com/sql 2006-04-30
</pre>
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | What Happens If NULL Values Are Involved in Bitwise Operations? |
☺ | How To Declare and Use Cursor Variables? |
☺ | PHP MSSQL - How To Delete Existing Rows in a Table? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
☺ | Can You Roll Back the DDL Statement in a Trigger? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |