Lets say we have the following tables: 1.Cars 2.CarTypes 3.Salesmen 4.Sales
Table relations: "Cars" is related to "CarTypes" "Sales" is related to "Salesmen", "Car", "Cartype" and has a field called "SalesPrice"
I need to produce a table where columns are: Salesmen, Cartype1, CarType2, CarType3...(as many columns as CarTypes we might have) In each row we would find the name of the salesman, total value of sales for each "CarType" he sold.
Since CarTypes might change over time, I need columns to build dynamically so I do not need to build a new query every time CarTypes change.
|