If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Select and Group By Clause

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-04, 11:05
kefka1911 kefka1911 is offline
Registered User
 
Join Date: Oct 2004
Posts: 3
Exclamation 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?
Reply With Quote
  #2 (permalink)  
Old 10-29-04, 11:28
DMWCincy DMWCincy is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 10-29-04, 11:41
kefka1911 kefka1911 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 10-29-04, 19:03
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
so basically you are reposting this question for some reason....

http://www.dbforums.com/t1051897.html
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On