how to select the min value using having key word

前端 未结 2 783
情书的邮戳
情书的邮戳 2021-01-21 22:54

I have created the table stu_dep_det

CREATE TABLE  `stu_dept_cs` (
  `s_d_id` int(10) unsigned NOT NULL auto_increment,
  `stu_name` varchar(15) , `gender` varch         


        
2条回答
  •  面向向阳花
    2021-01-21 23:51

    SELECT t1.* FROM stu_dept_cs t1
    LEFT JOIN stu_dept_cs t2
    ON t1.avg > t2.avg
    WHERE t2.stu_name IS NULL;
    

提交回复
热议问题