You don't need DISTINCT - the grouping will ensure that.
The SELECT and GROUP BY need the same expression in them. You have vdate and TO_CHAR (vdate, 'MM').
Which brings us to the real point: as the two tables have the same definition and vdate is presumably a DATE, how do you want to represent a month? e.g. should it be as 1st September 2009?
Finally, do you really want to add together data for August 2009, August 2008, August 2007, etc etc?
Last edited by DaPi; 09-22-2009 at 04:18 AM.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman