Sorry! I understand that the problem statement is very confusing. That dint work too 1. First I have the list of companies with various dates and stock values for that date. 2. I find the various combinations possible. Lets say n=2, I find all the possible combinations of two companies together. 3. Then for each of these possible combination (Ex: compA+compB), I find the average stock value based on the date. Thats the reason I used group by date. 4. Finally, after finding the averages for all dates of those two companies., I need to find the std dev of the averages. 5. This process needs to be repeated for all the possible combinations. Now, I have all the possible combinations of companies in a table I need to find the average stock value for every combination based on the date. That's what I am looking at. Thanks yet again!
... View more