Need some help joining these two tables
I have two views that looks like this
view1 view2
+------+--------+ +------+--------+
| code | SUM(*) | | code | SUM(*) |
+------+--------+ +------+--------+
| AAA | 4 | | AAA | 4 |
| BBB | 3 | | CCC | 1 |
+------+--------+ +------+--------+
I want to join them into a table that looks like this
+------+--------+
| code | SUM(*) |
+------+--------+
| AAA | 4 |
| BBB | 3 |
| CCC | 1 |
+------+--------+
I have tried, but only failed..
UNION DISTINCT.SUM(*)in your result be 4 (as it is now) or 8 (adding the two values forAAAtogether)?