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 |
|
terry06
Starting Member
1 Post |
Posted - 2006-05-09 : 13:18:17
|
Thanks a mil, Both worked a treat. Terry |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-05-09 : 13:30:39
|
| [code]SELECT A, BFROM( SELECT A, B, COUNT(*) AS Cnt FROM YourTable GROUP BY A, B) tWHERE Cnt = 1[/code]Tara Kizeraka tduggan |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2006-05-09 : 13:41:01
|
SELECT A, BFROM dbo.MytableGROUP BY A, BHAVING (COUNT(B) = 1) by TaraJimUsers <> Logic |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-05-09 : 13:44:53
|
| Yours is better though. I just didn't think of HAVING in this case even though I use it quite a bit.Tara Kizeraka tduggan |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-10 : 04:47:01
|
quote: Originally posted by terry06 Thanks a mil, Both worked a treat. Terry
Instead of editing the question, you should post your opinion as new replyMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|