Excel 2013 Stitching SQL strings

Source: Internet
Author: User

In the process of doing development, often need to according to the data in Excel database query, a small amount of data can also be copied and pasted, a large amount of data need to be in Excel data stitching into their own required SQL to improve productivity.

Scenario 1: Stitching a column into an in condition in SQL

Suppose you now have the following Excel data, I need to query the data from the database

The operation method is as follows:

Copy the resulting column of data into visual Studito code and replace it

Scenario 2:To stitch a column into a list in C #

Assuming that you now have the following Excel data, I need to write these values in list<string> in C #

The operation method is as follows:

Copy the resulting column of data into visual Studito code and replace it

Scenario 3: Stitching SQL statements

If you have the following SQL statement, you now need to replace the value of Storecode in the Where condition with the value in Excel

SELECTSt. Storecode, St. StoreName, S.sellername, so. Sellerorgname fromDbo. Fct_store asStINNER JOINDbo. Fct_seller asS onS.disabled= 0                                           andSt. Sellercode=S.sellercodeINNER JOINDbo. config_sellerorg asSo onSo. Disabled= 0                                                  andS.sellerorgcode=So . SellerorgcodeWHERESt. Disabled= 0         andSt. Storecode= '10000196';

Copy the SQL statement into Excel as described in Scenarios 1 and 2, prompting for the following information:

At this point, you need to use the concatenate () function in Excel, as follows:

Excel 2013 Stitching SQL strings

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.