I can't find a way to divide the result of my 2 queries.
They look like that :
SELECT periode, cee_ref_no, SUM(somme) AS total FROM V_STAT_NAMUR
WHERE code_ref_no IN (1, 2, 3, 4, 5, 6, 193, 215, 237, 259, 281)
AND periode BETWEEN '201401' AND '201412'
AND cee_ref_no = '961'
GROUP BY periode, cee_ref_no
ORDER BY periode;
AND
SELECT periode, cee_ref_no, SUM(somme) AS total FROM V_STAT_NAMUR
WHERE code_ref_no IN (7, 8, 9, 10, 205, 227, 249, 271, 293)
AND periode BETWEEN '201401' AND '201412'
AND cee_ref_no = '961'
GROUP BY periode, cee_ref_no
ORDER BY periode;
They look pretty similar, and both return something like this :
DATE | CEE_REF_NO | TOTAL
201401 | 961 | 10713
201402 | 961 | 9593
... | 961 | ...
201412 | 961 | 10426
How can I merge these to obtain something like this :
DATE | CEE_REF_NO | TOTAL
201401 | 961 | Total Q1/ Total Q2
201402 | 961 | Total Q1/ Total Q2
... | 961 | ...
201412 | 961 | Total Q1/ Total Q2
Everything I tried returned either only one row, or 12 rows with the same result.
Thanks a lot !