select distinct(fieldname) from tablename
解决方案 »
- VB中做一个判断TEXT输入字符的程序
- 如何向EXCELL中的文本框输入数据?
- 我用 Setup Factory 7.0打包,希望安装后执行一个程序(该程序已是由打包工具解压缩)
- VB中提交了数据以后,怎样得到回显的东西?进来详细.:)
- sqldmo.dll注册问题
- 关于VB的一些问题?
- 如何用VB实现FTP的断点下载?有人知道的话请回答,特急!!
- 哪位高手帮我做一道题呗、、知道这论坛高手云集!
- 在access中一次更新所有记录
- 100~300分 求助:是否可以实现这样的功能:用webBrowser控件,浏览网页,并能在该页面上任意处插入新的内容(如:html标识符,字符,图片等)……,请求高手指点,多谢了
- 关于ActiveX的疑问!
- 关于VB和VC++的
FROM table_name
WHERE (select COUNT(field2) from table_name)>1
(select COUNT(field2) from table_name)>1
只要数据库中有数据就会成立。
我说的显示前五行,是只在本例中、是指显示重复的行。
FROM 表名 Src
JOIN (SELECT 字段1,COUNT(字段1) AC Cnt
FROM 表名
GROUP BY 字段1) Tmp
ON Tmp.字段1=Src.字段1
WHERE Tmp.Cnt>1
from tableName
where fld2 in
(select fld2
from tableName
where (select Count(fld2) from tableName)>=2)
from tableName as a
where fld2 in
(select fld2
from tableName as b
where (select Count(fld2) from tableName as c where c.fld2=b.fld2)>=2)
尚末測試
2 aaa pojlk;klk
3 aaa lkjlk;jlk
4 bbb aldksj;
5 bbb asdfas这不是你想要的结果?
或者你还有其他的条件限制?!
select * from table1 where field2 in (select field2 from table1 group by field2 having count(b)>1)经过测试的。
---------sindyzhou
select *
from tableName as a
where fld2 in
(select fld2
from tableName as b
where (select Count(fld2) from tableName as c where c.fld2=b.fld2)>=2)
--------of123()
select * from table1 where field2 in (select field2 from table1 group by field2 haing count(b)>1)