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 |
DatabaseStudent
Yak Posting Veteran
71 Posts |
Posted - 2014-06-21 : 14:15:19
|
I have a base query where I set @ProductCategory. If I have 5 of those, and a long query that needs each to be defined specifically to pass through calculations on each @ProductCategory, how would I write it to cycle through each @ProductCategory.For simplicity sake:Select *FROM ProductsWHERE ProductCategory = @ProductCategoryWhat would be another way to cycle through each @ProductCategory to get the same results as you would have withSelect *FROM ProductsI believe this is tied to a Stored Procedure. Basically, would want similar to a loop statement to run ProductCategory1 through however many ProductCategories exist in the Products table to produce the results. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
DatabaseStudent
Yak Posting Veteran
71 Posts |
Posted - 2014-06-21 : 19:31:22
|
Thanks for the response and helping to continue my SQL Server growth... I will investigate this and write back if there are any issues. |
|
|
|
|
|