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 |
|
olocin
Starting Member
9 Posts |
Posted - 2005-04-14 : 21:48:33
|
| Hi I need help on how to display duplicate values on my table w/out specifying any string.. tahnk you so much |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-04-15 : 01:21:47
|
| Use the HAVING clause??? Give us an example.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-04-15 : 02:21:36
|
| use group by with the having clause for count > 1--------------------keeping it simple... |
 |
|
|
olocin
Starting Member
9 Posts |
Posted - 2005-04-15 : 02:29:44
|
| see i have table named accounts.. and have 3 columns namely (col1,col2,col3)on col1, i have dis values ("nicolo","john Doe", "nicolo", "Rana","nicolo","john Doe")Now wat i Want to do is to display duplicate values, without using the string as reference. Select col1 from accountswhere col1='nicolo' and 'john Doe'-------->> not like this Wat I need is the Opposite of DISTINCT where i can display duplicate values, |
 |
|
|
olocin
Starting Member
9 Posts |
Posted - 2005-04-15 : 02:33:21
|
| hi jen, ill try GROUP, DEN ILL POST THE CODE AND CAN U CHECK IT? Im not dat good in SQL |
 |
|
|
olocin
Starting Member
9 Posts |
Posted - 2005-04-15 : 02:40:03
|
| i have syntax errorSelect from accountswhere col1group by count > 1----> cant get it right :) |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-04-15 : 04:22:51
|
quote: Originally posted by olocin i have syntax errorSelect from accountswhere col1group by count > 1----> cant get it right :)
select col1 from accountsgroup by col1having count(*)>1--------------------keeping it simple... |
 |
|
|
olocin
Starting Member
9 Posts |
Posted - 2005-04-15 : 04:49:52
|
| select col1 from accountsgroup by col1having count(*)>1-------------------the syntax displays only the last row in the column, it should display all same data in col1 |
 |
|
|
|
|
|
|
|