用sql语句搜索出没有重复的记录 怎样用sql语句在一个表中搜索出某个字段没有重复的记录. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select distinct fieldname form tablename select * from table a where (select count(*) from table where a1=a.a1)=1 SELECT id,COUNT(*)AS count FROM user GROUP BY id HAVING count>1;如果能搜索到就说明该字段重复为了使一个字段不存在重复值,可以为该字段设置 主键 或 UNIQUE select distinct fieldname form tablename to : idlientselect distinct fieldname form tablename 可以,但是这样怎么显示所有记录?to : shuixin13UNIQUE 怎么用? to : idlient写错了,不好意思.select distinct fieldname form tablename 可以,但是这样怎么显示所有字段? select distinct * from yourtable select distinct fieldname form tablename SELECT id,COUNT(*)AS count FROM user GROUP BY id HAVING count>1;决定的经典 程序员去年的11 12 期 杂志上有篇文章。 SELECT id,COUNT(*)AS count FROM user GROUP BY id HAVING count>1; select * distinct fieldname form tablename distinct是把重复的字段只显示一个,还是用having对 select distinct * form tablename 还是解决不了.请说更详细点.谢谢.select distinct Mobile from user where not isNull(ServiceID)我想把 Mobile字段中有重复的记录只取一个. select Top 1 Mobile from user where not isNull(ServiceID) 下面的语句能查出重复的记录select mobile from user where mobile in(select mobile from user) 如果有a,b,c,d四个字段想查重复记录怎么查啊select distinct(a,b,c,d) form tablename怎么写?---------------------对不起了guolinchao (荒地校园) 借帖子一用。 这种问题多想想就行了。再不行就找一些SQL方面的书看啊。 解决了:id in (select max(id) from User group by Mobile ) 向下包含的SQL语句请教? 要现成的有源码的 呵呵,放分罗 子form 删除的问题? RAVE 怎么搞的,真TMD 不好用!,找遍了CSDN ,还没有找到答案! 请用过RAVE 的进来看看! 怎样让同一OpenDialog,在确认打开文件之前,不会再被执行一次? 关于Panel的一个简单的问题 Delphi6调用VB编写的dll 有人知道如何在FORM中画一个“点”吗???XZXCAZ Delphi5小问题求助?? ICO图标??? 如何根据一个数学公式用delphi画出用灰度表示的图形
可以为该字段设置 主键 或 UNIQUE
select distinct fieldname form tablename 可以,但是这样怎么显示所有记录?to : shuixin13
UNIQUE 怎么用?
写错了,不好意思.
select distinct fieldname form tablename 可以,但是这样怎么显示所有字段?
决定的经典 程序员去年的11 12 期 杂志上有篇文章。
select distinct Mobile from user where not isNull(ServiceID)
我想把 Mobile字段中有重复的记录只取一个.
select mobile from user where mobile in(select mobile from user)
select distinct(a,b,c,d) form tablename
怎么写?
---------------------
对不起了guolinchao (荒地校园) 借帖子一用。
id in (select max(id) from User group by Mobile )