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 |
|
disastor
Starting Member
2 Posts |
Posted - 2005-05-12 : 13:03:33
|
| Hi All,I was referred to you from 4guysfromrolla web site with the hopes that you could assist me. I currently have a 3 column table that lists customer names, street addresses and states.I am trying to come up with a query that will pull just the top 3 customers from each state. I've tried something like the following, but it only yields a total of 3 results:SELECT * FROM (SELECT TOP 3(customername), state FROM table WHERE state IN (SELECT DISTINCT(state) FROM table)) Can you guys help out?Thanks in advance. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
disastor
Starting Member
2 Posts |
Posted - 2005-05-12 : 13:20:00
|
| Thank you, thank you, thank you!!!! That is exactly what I was looking for. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|