SQL (7) in SAS CREATE VIEW, update view, delete view

Source: Internet
Author: User

What is a view?

A view is a series of query statements that are executed when used to obtain the desired subset (subset) or superset (superset) from other datasets or views.

The view contains only the logic for accessing the data and not the data itself

Where can the view be used?

Almost anywhere in the SAS program where the real table is used (not available in the list).

What are the benefits of using views?

1: Save space, views tend to be much smaller than the real table.

2: Prevent users from frequently make Table query and ignore the dictation column, the view is written every time the call on the line, and Inline-view need to rewrite each time

3: Ensure the data set can be updated in real time.

4: Masking columns in other tables that you don't want to show

5: Masking complex connections or queries to users

What should I be aware of when working with views?

1: In the query clause try to avoid order by, users who use view may have different purposes, and whether to use order by should be determined by different users

2: Avoid creating views based on easy-to-change tables

3: If the same data is used many times, it is better not to create a view but to create a static table directly.

Create a connection

When you create a connection, the system does not execute a SELECT statement, but compiles and stores it in a file of the view type.

Description View

How to create a view based on another view, it is necessary to use the feedback option to describe the content.

Update view (syntax is the same as table)

1:you can only update a single table through a view. The table cannot is joined or linked to another table, nor can it contain a subquery.

2: Youcan update a column using the column's alias, but you cannot update a derived column

3: Youcan update a view that contains a WHERE clause. The WHERE clause can, specified in theUPDATE clause or in the view. You cannot update a view, contains any and clause such as an ORDER by or a have clause.

4:you cannot update a summary view (a view, contains a GROUP by clause).

Delete a view

SQL (7) in SAS CREATE VIEW, update view, delete view

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.