(Also posted here.)
So I have two tables, one is invalid table and the other is valid table.
valid table:
id
status
date
invalid table:
id
status
date
I have to produce a report with this output:
date on-time late total valid invalid1 invalid2 total rate
--------- ------- ---- ----- ----- -------- -------- ----- ----
9/10/2011 4 10 14 3 3 3 6
date: common fields on the 2 tables, field to group by, how many records on that day hason-time: count of all the id on the valid tablelate: count of all the records(id) on the invalid tabletotal: total of on-time and latevalid: count of id on the valid table with the “valid” statusinvalid1: count of id on the invalid table with “invalid1” statusinvalid2: count of id on the invalid table with “invalid2” statustotal: total of valid, invalid1, invalid2rate: average of totals
It’s basically multiple queries with different table. How can I achieve it?
Someting like this?