Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Select question

Author  Topic 

bspama
Starting Member

8 Posts

Posted - 2002-11-11 : 12:18:59
Hi, just wanted to ask how i can select all documents in a table that have duplicate values or is Not Unique? Thanks!



Edited by - bspama on 11/11/2002 12:19:56

nr
SQLTeam MVY

12543 Posts

Posted - 2002-11-11 : 12:21:42
select fld
from tbl
group by fld
having count(*) > 1
?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

bspama
Starting Member

8 Posts

Posted - 2002-11-11 : 12:43:09
Thanks for the quick reply!

Go to Top of Page

bspama
Starting Member

8 Posts

Posted - 2002-11-12 : 08:28:35
NR, i have another question..

i have two fields, field1 which is an integer and field2 which is text, how do i select all documents in a table that have duplicate values or is not unique and sorted based on their corresponding field1 integer values?

thanks again.

quote:

select fld
from tbl
group by fld
having count(*) > 1
?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.



Go to Top of Page
   

- Advertisement -