September 20, 2012 at 6:38 pm
Hi guys I need your help on something.
I have to deal with a huge data base with thousands of aggregation groups.
I am dealing with a portfolio and I have to figure out a query that comes with the following results: 1.)the peak day within a year of each aggregation group(each aggregation group consists of many days in a portfolio), 2.)the peak value of each aggregation group(each aggregation group also consists of many values) 3.)peak day within lifetime of portfolio of each aggregation group and 4.)peak value within lifetime of each aggregation group.
Lifetime refers to to the years of the portfolio it might be a 30 year portfolio for example.
The columns names are the following: aggr__group, Time_Horizon and EPE.
I have been told that It should be one query.
I would really appreciate your help at this point because it is really important to me.
Anything could help at this point.
Thank you in advance
September 20, 2012 at 11:42 pm
pls send ddl data...
September 20, 2012 at 11:46 pm
Sounds like an interesting problem.
But you'll need to provide some DDL (CREATE TABLE statements), sample data and a clear picture of the expected results.
That will assure you get a tested solution.
Since you're new, I suggest you look through a couple of other posts for examples. There's quite a number of regular posters that have links in their signature line to articles that suggest the best way to post DDL, sample data and expected results.
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply