Firstly, I want to thank you for responding.
Secondly, I wonder if I should only reply to the mailing list (I clicked Reply All); if this is the case, I apologize for any inconvenience. Please let me know so I reply correctly next time.
I will describe my issue with more detail. I need to perform 2 very similar queries as follows:
*** QUERY 1 ***
SELECT fldA, fldB, fldC, SUM(fldD) AS fldD
FROM tableA
WHERE condition1
GROUP BY fldA, fldB, fldC
*** QUERY 2 ***
SELECT fldA, fldB, fldC, SUM(fldD)*(-1) AS fldD
FROM tableA
WHERE condition2
GROUP BY fldA, fldB, fldC
As you can see, both reference the same table and the same fields.
The differences between the queries are:
a) The last SELECTED field is multiplied by (-1) in the second query.
b) The WHERE conditions.
What I finally need is to exclude records generated by QUERY1 from QUERY2 when fldA, fldB and fldC are equal in both results.
With respect,
Jorge Maldonado