That is exactly what I've done to get to the current point (e.g. prepare the table that joined all relevant data into one).
But this doesn't work from this point on as I need to find all unused codes for each country and allunused countries (with their unujsed codes) for each date as denormalization is the object here. I'm thinking of somwhow breaking them up into pieces then rejoin (maybe a UNION?)
>>>>>>>>>>>>>>>>>
>to join Transactions with Countries with nulls, just use LEFT JOIN or RIGHT JOIN. Something like following:
>
>select t.ddate, c.code, count(*) as tcount from Countries c LEFT JOIN Transactions t on c.code=t.code group by c.code
>
>Just change the order of tables - select all countries, than join other records to is with LEFT JOIN.
>
>HTH.
>>>>>>>>>>>>>>>>>