CREATETABLEIFNOTEXISTSt_stu(idBIGINTUNSIGNEDPRIMARYKEYAUTO_INCREMENT,gmt_createDATETIME,gmt_modifiedDATETIME,nameVARCHAR(20),numVARCHAR(20),sexCHAR(2),bornDATE,cla_idBIGINTUNSIGNED);INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('汤','20130090221','男','1991-10-22',1,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('暴','20130090222','女','1989-06-10',1,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('凤','20130090223','女','1993-07-04',1,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('佴','20130090224','男','1990-09-10',1,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('宁','20130090225','女','1991-07-07',2,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('瀚','20130090226','男','1992-04-01',2,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('汲','20130090227','女','1995-05-26',2,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('童','20130090228','男','1988-02-09',2,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('佩','20130090229','女','1991-01-27',2,NOW());INSERTINTOt_stu(name,num,sex,born,cla_id,gmt_create)VALUES('充','20130090230','女','1993-07-12',2,NOW());1. 查询每个班年龄最小的2个学生2. 查询每个班年龄第二小的学生这两个查询怎么写?没找到思路
相关分类