Use of Views in SQL (simple view) for entry-level

Source: Internet
Author: User

Creating a view makes it easier to call data from one library to another (for example, to transfer 209 libraries to 205 libraries).

Example: 209 libraries have different library names: Database (AIS20140417092531 film library) supplier Table (T_supplier), Database (AIS20140417092652) supplier table (T_supplier)

Vendor table data: Primary key (Fitemid), Vendor name (FName), etc.

Vendor table data: Primary key (Fitemid), Vendor name (FName), etc.

Now we have to put the supplier table of the library in 209 and the contents of the supplier table of the glue library into the 205 database, so that we can use the view to achieve the desired effect (example is that the example itself may be very irregular, but it is the approximate meaning)

SELECT Fitemid, FName, ' film ' as ' Fdbname '
From KIS. AIS20140417092531.dbo.t_Supplier as T_supplier_1
UNION All
SELECT Fitemid, FName, ' glue ' as ' fdbname '
From KIS. AIS20140417092652.dbo.t_Supplier as T_supplier_1

Use of Views in SQL (simple view) for entry-level

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.