Two ways to use MySQL in

Source: Internet
Author: User

Briefly describe the two usages of MySQL in:

They are followed by a table (recordset) in the In keyword, and a string set after in.

Let's go ahead and follow a table.


First, the structure of three tables is elaborated:

S (sno,sname.sex,age,dept)//Student Information Sheet

C (cno,cname,tname)//Course Information Sheet

SC (Sno,cno,grade)//course Elective Information sheet

Update SC Set grade = 0 where sc.cno in (select CNO from c where c.cname = ' physical ') and Sc.grade < 60; For example, this SQL statement, which is a 0-point set of failed scores for a course, is a physical one.

In this example, the in is followed by a temporary table generated by the SELECT statement.


OK, now look at the following in followed by a string set, it is not necessarily a string set.

SELECT * from S where sname in (' AAA ', ' BBB ', ' CCC ');




Two ways to use MySQL in

Related Article

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.