现求一个select 语句,查询列出这个表中所有 password 字段相同的记录!!!!急急!!! 现有一个表,字段有两个: id和password现求一个select 语句,查询列出这个表中所有 password 字段相同的记录 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tablename where group by password; select a.* from tbl a, tbl b where a.password=b.password 错了,应该是:select * from tablename group by password; select * from table a where (select count(*) from table where password=a.password)>1 刚才写的不对,会引起交叉结果,试试下面的:select a.* from tbl a, (select password, count(password) as sc from tbl) b where a.password=b.password and b.sc>1 select * form tablename where passwoord in (select password form tablename group by password having count(1)>1); select a.* from gbook a, (select uname from gbook group by uname having count(uname) > 1) b where a.uname = b.uname这个也对,引用打字员的,呵呵 select * from tablename group by password语句给你写了,但我估计执行不了,因为password和大多数数据库的关键字冲突建议换个字段名称 几个我没有弄明白的问题 用D2010的帮忙RC个ICO datetimepacker取得去年今天的时间? 请问FreeAndNil、Destroy、Destroy、FreeInstance有什么区别 如何捕捉程序主窗体是否最小化,如果是并将其最大化? 处理ADO数据库连接异常的类是什么? 看这张照片,你会哭吗? 如何使用HTTP协议在Server Client之间实现信息的互传 insert 语句写法问题 有没有DELPHI写的多线程Socket数据传输例子? 打印 一个sql语句问题?
select * from tablename group by password;
where (select count(*) from table where password=a.password)>1
select a.* from tbl a, (select password, count(password) as sc from tbl) b where a.password=b.password and b.sc>1
where a.uname = b.uname
这个也对,引用打字员的,呵呵
语句给你写了,但我估计执行不了,因为password和大多数数据库的关键字冲突
建议换个字段名称