I have a table which keeps the record of inbound/outbound domestic/international mails for different dates. Here is the sample table:
Date location in_out_code dom_int_code mail_count
------------------------------------------------------------------------------
11/01/2012 chicago in I 3
11/02/2012 la in I 2
11/03/2012 ny in I 4
11/03/2012 ny out D 5
11/04/2012 phoenix out D 1
11/05/2012 phoenix in D 3
I want to create a table which stores all the combinations for each day, like the following (for readability I broke down the output):
Date location in_out_code dom_int_code mail_count
----------------------------------------------------------------------------
11/01/2012 chicago in I 3
11/01/2012 chicago in D 0 <-- inserted
11/01/2012 chicago out I 0 <-- inserted
11/01/2012 chicago out D 0 <-- inserted
11/02/2012 la in I 2
11/02/2012 la in D 0 <-- inserted
11/02/2012 la out I 0 <-- inserted
11/02/2012 la out D 0 <-- inserted
11/03/2012 ny in I 4
11/03/2012 ny in D 0 <-- inserted
11/03/2012 ny out I 0 <-- inserted
11/03/2012 ny out D 5
11/04/2012 phoenix in I 0 <-- inserted
11/04/2012 phoenix in D 0 <-- inserted
11/04/2012 phoenix out I 0 <-- inserted
11/04/2012 phoenix out D 1
11/05/2012 phoenix in I 0 <-- inserted
11/05/2012 phoenix in D 3
11/05/2012 phoenix out I 0 <-- inserted
11/05/2012 phoenix out D 0 <-- inserted
How will I do that. Any suggestion?
Thanks