Querying data using SQL statements in Excel (vi) Application of-----in statement

Source: Internet
Author: User

What we're going to share with you today is the IN keyword in the SQL statement. The purpose of this in is to display all the data that the field value contains in a collection. field name in collection

If you do not understand, you can slowly realize from the following process. The data source is one of the courses in Basic, CONFERENCE, SAP, and we want to find out the names of both basic and CONFERENCE courses, that is, finding two columns of the same data.

650) this.width=650; "style=" Float:none; "title=" 31.JPG "src=" http://s3.51cto.com/wyfs02/M00/6D/9E/ Wkiol1vn8txjtbs8aagu6ykgq_4043.jpg "alt=" Wkiol1vn8txjtbs8aagu6ykgq_4043.jpg "/>

First create a data connection with OLE DB, and then enter the following SQL statement:

SELECT Basic as ' basicandconference ' with Basicandconference as the column name

from [sheet1$]

where Basic in (Select Conference from [sheet$]) displays the condition with where to control the output of the row, displaying data in the Basic column that also appears in the Conference column

650) this.width=650; "style=" Float:none; "title=" 32.JPG "src=" http://s3.51cto.com/wyfs02/M00/6D/A2/ Wkiom1vn8uegnhecaahcyod6t4a348.jpg "alt=" Wkiom1vn8uegnhecaahcyod6t4a348.jpg "/>

The results are as follows

650) this.width=650; "style=" width:609px;float:none;height:231px; "title=" 33.JPG "src=" http://s3.51cto.com/wyfs02/ M01/6d/9e/wkiol1vn8u3jk9r1aaiqasrrz0g656.jpg "width=" 415 "height=" 161 "alt=" wkiol1vn8u3jk9r1aaiqasrrz0g656.jpg "/ >

This article is from the "Guo Yong Technology blog" blog, make sure to keep this source http://guoyong.blog.51cto.com/408495/1656287

Querying data using SQL statements in Excel (vi) Application of-----in statement

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.