Hi Limno,
Almost there,
Please allow me to give a maybe better example.
I used the above to simplefy things, but that does not work
because there are more parameters involved :-(
Lets say I have a few banners that are shown on different websites.
So
A. there is a table for banners
| Banners |
| BannerID |
BannerName |
| 1 |
AboutASP |
| 2 |
TryDotNet |
| 3 |
TryAjax |
B. there is a table for websites (SiteID, SiteName, etc)
| Sites |
| SiteID |
SiteName |
| 1 |
forums.ASP.Net |
| 2 |
Microsoft |
| 3 |
msdn |
C. there is a table for impressions (impID, BannerID, SiteID, Date, etc)
| Impressions |
| impID |
BannerID |
SiteID |
| 1 |
1 |
1 |
| 2 |
1 |
2 |
| 3 |
3 |
2 |
| 4 |
1 |
1 |
| 5 |
2 |
3 |
| 6 |
2 |
1 |
| 7 |
3 |
1 |
D. there is a table for sales (salesID, BannerID, SiteID, Date, etc)
| Sales |
| salesID |
BannerID |
SiteID |
| 1 |
2 |
3 |
| 2 |
1 |
2 |
| 3 |
2 |
1 |
| 4 |
3 |
1 |
E. for each banner there are impressions and sales. This is the result I like to have
| BannerName (ID) |
SiteName (ID) |
# Impressions |
# Sales |
| AboutASP (1) |
forums.ASP.Net (1) |
2 |
0 |
| AboutASP (1) |
Microsoft (2) |
1 |
1 |
| TryDotNet (2) |
forums.ASP.Net (1) |
1 |
1 |
| TryDotNet (2) |
msdn (3) |
1 |
1 |
| TryAjax (3) |
forums.ASP.Net (1) |
1 |
1 |
| TryAjax (3) |
Microsoft (2) |
1 |
0 |
| |
|
|
|
| |
totals |
7 |
4 |
I hope this clears things up.
Best regards,
Bonaparte