(SqlServer) Data splitting and merging

Source: Internet
Author: User
Background: I encountered the problem of data merging and splitting today. I tried several writing methods. However, it can be roughly divided into two categories: 1. Original writing. Ii. Supported syntax after SqlServer2005. The first method is complex and inefficient. It is not recommended. The second method is described below. Data Splitting: first, we will introduce two functions: cross.

Background: I encountered the problem of data merging and splitting today. I tried several writing methods. However, it can be roughly divided into two categories: 1. Original writing. Ii. supported statements after SQL Server 2005. The first method is complex and inefficient. It is not recommended. The second method is described below. Data Splitting: first, we will introduce two functions: cross.

Background:

Today, I encountered the problem of data merging and splitting and tried several writing methods. However, it can be roughly divided into two categories: 1. Original writing. Ii. supported statements after SQL Server 2005. The first method is complex and inefficient. Hong Kong space is not recommended. The second method is described below.

Data Splitting:

Before sharding, we will first introduce two functions: cross apply and outer apply. These two functions are used for cross-join. These two functions are available only after SQL server 2005. The website space is similar to the cross join function in SQL server 2000. Although similar, Hong Kong servers are rented, cross join has a fatal feature defect. For details, see the code:

TEST01 AS T01 cross join FUNC_TB2 (T01.FIELD1) -- FUNC_TB2 is a table Value Function

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.