社区
疑难问题
帖子详情
求一sql语句
blue_snow
2003-10-21 10:12:29
我想把一个表的三个字段a,b,c加为主键,但是里面有重复数据(即三个字段的值都一样)我怎么查出那些记录来呢?
...全文
38
17
打赏
收藏
求一sql语句
我想把一个表的三个字段a,b,c加为主键,但是里面有重复数据(即三个字段的值都一样)我怎么查出那些记录来呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
17 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xcloudky
2003-10-24
打赏
举报
回复
去网上找!
yonghengdizhen
2003-10-24
打赏
举报
回复
to blue_snow(因为所以)
存在性判断你管它输出什么干吗?
blue_snow
2003-10-24
打赏
举报
回复
我想问一下:select * from 表 tem where exists(
Select 1 from 表 group by a,b,c having count(*) > 1 and a=tem.a and b=tem.b and c=tem.c)中,select 1 是什么意思,有些看不懂
yonghengdizhen
2003-10-23
打赏
举报
回复
Select * from tablename ta where (select count(*) from tablename where a=ta.a and b.ta.b and c=ta.c)>1
xjwxiong
2003-10-23
打赏
举报
回复
select a,b,c,sum(d) as d from (select a,b,c,1 as d from table1)A
where d>1
group by a,b,c
guangli_zhang
2003-10-22
打赏
举报
回复
对不起,写错了
select * from table1 aa where (select count(*) from table1 bb where bb.a = aa.a and bb.b = aa.b and bb.c = aa.c) >= 2
guangli_zhang
2003-10-22
打赏
举报
回复
select * from table1 aa where (select count(*) from table1 bb where b.aa = a.aa and b.bb = a.bb and b.cc = a.cc) >= 2
银狐被占用
2003-10-21
打赏
举报
回复
select a,b,c from 表 group by a,b,c having count(*)>1
pengdali
2003-10-21
打赏
举报
回复
Select * from 表 where a=b and a=c
??
blue_snow
2003-10-21
打赏
举报
回复
to 大力
你的语句效果是一样的,我只想查出那些三个字段都一样的记录
lijinqiang
2003-10-21
打赏
举报
回复
pengdali(大力 V3.0)能达到效果
welyngj
2003-10-21
打赏
举报
回复
select * from tbl a where exists ( select a,b,c from tbl b where a.a=b.a
and a.b=b.b and a.c=b.c group by a,b,c having count(a)>1 )
blue_snow
2003-10-21
打赏
举报
回复
to 马可
按照你的方法还是查不出有哪些记录是重复的呀
pengdali
2003-10-21
打赏
举报
回复
select * from 表 tem where exists(
Select 1 from 表 group by a,b,c having count(*) > 1 and a=tem.a and b=tem.b and c=tem.c)
txlicenhe
2003-10-21
打赏
举报
回复
Select a,b,c from 表 group by a,b,c having count(*) > 1
lynx1111
2003-10-21
打赏
举报
回复
都是对的,楼主自己好好测一下
qdubit
2003-10-21
打赏
举报
回复
select a,b,c from 表 group by a,b,c having count(*)>1
SQL语句
基础教程
SQL语句
基础教程
SQL学习资料(包含所有常用的语句例子)
sql学习必备,内含sql一些常用语句的例子,有图有表,通过结果来理解
sql语句
的实现与结果。
oracle sql developer 执行
sql语句
,如何使用SQL Developer执行
SQL语句
(上)
在这一部分,我们将会学习如何使用SQL Developer来输入并执行
SQL语句
及脚本。如何使用摘录窗口,解决常见的语法错误等内容。在你回顾数据库设计的同时,SQL Developer还是一个很好的可输入并运行
SQL语句
的工具。在接...
PLSQL执行
SQL语句
PLSQL执行
SQL语句
1、执行中量
SQL语句
当执行
SQL语句
较大时,除运行
SQL语句
外可以点击工具------->导入表--------->(出现界面如下图所示) 点击导入就会出现执行语句的窗口如下图所示,把语句...
SQL语句
一对多查询
效果如下 2个表 spr_course sys_user 表中我们可以发现一个科目会有多个老师教,如果我们直接进行表连接的话...
sql语句
一对多(spr_course和sys_user表) SELECT spr_course.*,GROUP_CONCAT(sys_user.`username`) AS...
疑难问题
22,210
社区成员
121,730
社区内容
发帖
与我相关
我的任务
疑难问题
MS-SQL Server 疑难问题
复制链接
扫一扫
分享
社区描述
MS-SQL Server 疑难问题
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章