https://www.w3school.com.cn/sql/sql_like.asp
查询:select * from 表名 where 字段 = ‘字段中值’
连表查询:
学生表信息(Students):
ID | Name | Age | City | MajorID |
101 | Tom | 20 | BeiJing | 10 |
102 | Lucy | 18 | ShangHai | 11 |
专业信息表(Majors):
ID | Name |
10 | English |
12 | Computer |
select Students.ID,Students.Name,Majors.ID AS MajorName from Students LEFT JOIN Majors ON Students.MajorID = Majors.ID
结果:
ID |
Name |
MajorName |
101 |
Tom |
English |
102 |
Lucy |
NULL |