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 |
vojinb
Starting Member
9 Posts |
Posted - 2010-12-17 : 07:06:24
|
Hi,I'm having table with clients and contracts, contract number is key,one client could have more then one contract.How can I select clients with only one contract? |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-12-17 : 07:23:02
|
select * from table t1join (select clientId from table group by clientId having count(*)=1)dton dt.clientId=t1.clientId No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
vojinb
Starting Member
9 Posts |
Posted - 2010-12-17 : 07:54:24
|
Thanks,it's working |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-12-17 : 08:02:53
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|