Hi guys, one advice please. Bear in mind that I don't have SQL now so I cannot give you the DDL (sorry). My concern is for a task that I need to resolve on Monday. I got a table with 200 million rows and several columns, anyway what I need for this task is the SDate (datetime2), the period (hours), the idplane, the oilplane ( the measure of the capacity fuel). In another table I got, idplane, model. So linking the idplane I got even the idmodel, So far, easy.
What I need is a calculation that take three different date and period ( the same for all the planes, we can say 1-1-2014 per 5 / 5-2-2014 per 7 / 18-2-2014 per 22 each date and period as even a rate so
1-1-2014 5 456,34
5-2-2014 7 554,76
18-2-2014 532,65
I need to take ( unfortuneley I just try to remember, I dunno if is the correct calculation but eventually....) the average of the three date/period for each idplane and multiply this per 2. That's something that I need to do in the main link, table1 and table 2. Once I got this I should multiply for the average of the three rates ( bear in mind that the rates depends on the model..idmodel). By the moment that I'm going to work with 200 millions rows is quite impossible to don't have problem with the performaance...whitch is the faster and best way? Any advice? Thanks