求SQL语句 现有一个学生名单表 id name sex age 其中id为自增长字段要求删除掉重复的数据(即name,sex,age都相同),保留id最小的数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from tablename where id not in(select min(id) from tablename group by name,sex,age) delete a from tb awhere exists (select 1 from tb where name=a.name and sex=a.sex and age=a.age and id<a.id) delete from tablename where id not in(select min(id) from tablename group by name,sex,age) http://topic.csdn.net/u/20110616/17/5d2c1888-a086-48b6-9fa8-4865005d454e.html?50830批量查询重复记录不同的方法 个人认为很难解决,高手帮忙 请问一下SQL SERVER的登陆与数据库用户必须是一一对应吗,能否一个数据库用户对应多个登陆帐号? SQL里怎样更新这样的字段?(不好表达,见描述就明白了) 游标的定位问题 请问这样写出了什么问题啊,,有关于数据库查询方面的,,这道题应该怎么样做才可以啊,,请各位指教 将几条数据转换成一个字段内容 求帮助 SQL不是不区分大小写吗? 大哥!小弟笨笨,帮我呀@! 如何写这条sql 这个语句是什么意思 【sql】日期格式比较,求解!
where id not in(select min(id) from tablename group by name,sex,age)
where exists (select 1 from tb where name=a.name and sex=a.sex
and age=a.age and id<a.id)
where id not in(select min(id) from tablename group by name,sex,age)