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.
| Author |
Topic |
|
bspama
Starting Member
8 Posts |
Posted - 2002-11-12 : 10:28:31
|
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 in the field2 or is not unique and sorted based on their corresponding field1 integer values? Thanks! |
|
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 2002-11-12 : 10:40:02
|
| select t.field1, sl.field2from (select field2 from table1 group by field2 having count(*) > 1) as sljoin table1 t on sl.field2 = t.fieldl2order by t.field1 |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2002-11-12 : 10:40:15
|
quote:
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 in the field2 or is not unique and sorted based on their corresponding field1 integer values? Thanks!
I could have sworn that you already asked thathttp://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=21502 |
 |
|
|
bspama
Starting Member
8 Posts |
Posted - 2002-11-12 : 10:44:51
|
Yup, but i forgot to ask how to sort it by the integer field that is why i decided to post it again and add that bit. Thanks to those who replied. |
 |
|
|
|
|
|