【8】查询练习:子查询
1.查询和学号11328、11427同学同年出生的所有学生的stu_num、stu_name、stu_birth; 查询11328与11427: mysql> select * from student where stu_num in (11328,11427); +---------+----------+---------+---------------------+-------+ | stu_num | stu_name | stu_sex | stu_birth | class | +---------+----------+---------+---------------------+-------+ | 11328 | DingQi | F | 1994-08-15 00:00:00 | 113 | | 11427 | NanNan | F | 1995-10-20 00:00:00 | 114 | +---------+----------+---------+---------------------+-------+ 查询年份:使用year函数: mysql> select year(stu_birth) from student where stu_num in (11328,11427); +-----------------+ | year(stu