I have a couple of queries that return the same table structure:
What I'm trying to do is join the two results into one set, that gives me a sum of the full and partial columns for each productid, and a count of the productids. So the result would look something like this
Anybody able to think of how I might be able to do this?
Thanks.
Code:
Result A
productid full partial
--------- ---- -------
1 2 0
2 0 1
3 0 1
Result B
productid full partial
--------- ---- -------
1 1 0
3 1 1
4 1 0
Code:
Result Final
productid count full partial
--------- ----- ---- -------
1 2 3 0
2 1 0 1
3 2 1 2
4 1 1 0
Anybody able to think of how I might be able to do this?
Thanks.