删除重复数据

delete from student where id not in (select minid from (select min(id) as minid from student group by name) b);

        $sql = 'delete from tbTeachingV3Student where id not in
                (
                    select minid from
                     (select min(id) as minid from tbTeachingV3Student group by fdTeachingV3ID,fdStudentID
                     ) b
                 )';

posted on 2016-10-13 14:07  会学习的猪  阅读(129)  评论(0编辑  收藏  举报

导航