Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Exclamation Unanswered: Select and Group By Clause

    This is my Select Statment for my Webpage.
    Sql = "select SUBJECTS, ORG_LEVEL_1, RECORD_OWNER, DELETION_DATE "_
    & "from XML_EXPORT "_
    & "order by SUBJECTS;"

    I want to use the GROUP BY Clause to Group my Subjects togeather.
    When I try adding the line (group by SUBJECTS)
    I get this error.
    "You tried to execute a query that does not include the specified expression 'ORG_LEVEL_1' as part of an aggregate function. " What should I do?

  2. #2
    Join Date
    May 2004
    Posts
    125
    Everything in your select statement either has to be in the group by statement or aggregate function(sum, max, min, avg, etc). That is why you got that error.

    Sql = "select SUBJECTS, ORG_LEVEL_1, RECORD_OWNER, DELETION_DATE "_
    & "from XML_EXPORT "_
    & "gruop by SUBJECTS,ORG_LEVEL_1, RECORD_OWNER, DELETION_DATE ;"

    What are you trying to do by grouping? If we knew more about what you where trying to do we may be able to help you get the rs you want.

  3. #3
    Join Date
    Oct 2004
    Posts
    3
    My Subjects will have multiple values that are equal. For example, Abuse and Abuse, When I display it currently with the Select Statement I am currently using, It displays Abuse for each time it is show in the Database. I just want it to show it only once, then group all the fields that are related to it togeather.

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    so basically you are reposting this question for some reason....

    http://www.dbforums.com/t1051897.html

Posting Permissions

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