如何把数据库中编号相同的记录列出来?

hongsongboy 2003-06-13 04:07:34
如何把数据库中编号相同的记录列出来?
...全文
54 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ganzhiruogy 2003-06-13
  • 打赏
  • 举报
回复
select a.* from tablename where a.编号 in (select 编号 from tablename group by 编号 having count(编号)>1)
hongsongboy 2003-06-13
  • 打赏
  • 举报
回复
我的意思是,在不知道编号的情况下,如何找出所有的相同记录
饮水需思源 2003-06-13
  • 打赏
  • 举报
回复
strsql=" select a.* from tablename,(select 编号 from tablename group by 编号 having count(编号)>1) as b
where a.编号=b.编号 "
cppsong 2003-06-13
  • 打赏
  • 举报
回复
Dim cn as adodb.connection
dim rs as adodb.recordset
set cn=new adodb.connection
set rs=new adodn.recordset

cn.open "..."
rs.open "select * from 表名 where 编号=1000",cn,1,1
do while not rs.eof
'msgbox rs.fields(0).value
rs.movenext
loop
rs.close
cn.close
set rs=nothing
set cn = nothing

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧