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 |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2007-01-16 : 02:12:53
|
| i have 2 columns :1 -presson passport number2 - time which is this this : yyyymmddhhmmssand a passport+time can appear more then once with the same time(for example sending a message to a lot of pepole will write the same time)how can i check which of the pepole have more then 1 row in the DBin the same SECOND!for example :1111 200701161632321111 20070116163232in this case passpot number 1111 has 2 rowsthnaks in advancepelegIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 02:17:26
|
| select col1, col2 from yourtable group by col1, col2 having count(*) > 1Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 02:18:27
|
| I am amazed. Over 300 posts and still have no clue of GROUP BY.Peter LarssonHelsingborg, Sweden |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2007-01-16 : 02:28:33
|
| i do have but the soluton u gave me which i know dosent solve itsorry if i didnt make it clear i need every passport to appear only onceIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-16 : 02:38:56
|
How to modify my suggestion to deal with new information?select distinct col1, col2 from yourtable group by col1, col2 having count(*) > 1Peter LarssonHelsingborg, Sweden |
 |
|
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2007-01-16 : 02:54:36
|
| thnaks alotIsrael -the best place to live in aftr heaven 9but no one wan't to go there so fast -:) |
 |
|
|
|
|
|