DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: SQL Query Help !!

Threaded View

  1. #5
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width