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 |
|
bjornh
Yak Posting Veteran
87 Posts |
Posted - 2003-04-20 : 05:03:05
|
Hi there and happy easter Now, here's my problem:Iam using a sp that needs to select the top 1 count from +/- 15 columns in 1 table.example:select(select top 1 TABLE2.Name from TABLE1 join TABLE2 on TABLE1.nameID = TABLE2.id where *some conditions that are on all the selects the same* group by TABLE2.Name order by count(*) desc),(select....)So I have this sub select about 15 times only with some different columnnames and tables.This is pretty hard work for my server and voila, there is the question: Is there a better, less expensive, way...ThanksBjorn |
|
|
|
|
|