请问如何从一张表中选出若干列数据相同的行?
请问如何从一张表中选出若干列数据相同的行?
例如:表A
c1 c2 c3 c4 c5
----------------------
1 b c e f
2 a c e b
3 c a f d
4 w q f y
5 g a f t
6 v e w r
要求检索出c3,c4相同的行
即:结果显示为
c1 c2 c3 c4 c5
----------------------
1 b c e f
2 a c e b
3 c a f d
5 g a f t
问题点数:0、回复次数:6Top
1 楼pengdali()回复于 2003-06-01 10:28:01 得分 0
select * from 表a where exists (select 1 from (select c3,c4 from 表a group by c3,c4 having count(*)>1) tem where tem.c3=表a.c3 and tem.c4=表a.c4)Top
2 楼HawaiiLeo(罗马数字)回复于 2003-06-01 10:54:16 得分 0
select * from 表a A, (select c3,c4 from 表a group by c3,c4 having count(*)>1) tem where tem.c3=A.c3 and tem.c4=A.c4
Top
3 楼happydreamer(www.sz.js.cn,www.gyxk.com)回复于 2003-06-01 14:44:00 得分 0
select * from 表 where exists
(select 1 from 表 x where 表.c3 = x.c3 and 表.c4= x.c4 group by x.c3,x.c4 having count(*) >1)
Top
4 楼zwfixsoft(zw)回复于 2003-06-09 22:46:30 得分 0
我要如何给分呀?Top
5 楼zwfixsoft(zw)回复于 2003-06-20 19:35:41 得分 0
多谢了Top
6 楼zjcxc(邹建)回复于 2003-06-20 20:34:29 得分 0
点击管理,在看看你要给谁给分,就给谁输入所给的分数.
再输入你的登陆密码,点击给分按纽.Top




