Please help Try to COUNT - beginner *URGENT* [message #7364] |
Sun, 08 June 2003 10:34 |
Angela
Messages: 13 Registered: October 2000
|
Junior Member |
|
|
Hello,
Im trying to count the total of salesperson per region
and also join the 2 tables I have. Im using SQL plus 8.0. Here are my tables:
Salesperson table:
Salesperson_ID Salesperson_Region_ID
aaa E1
bbb E1
ccc W2
ddd W2
fff S4
Salesperson_Region Table:
Salesperson_Region_ID Salesperson_Region_Descrip
E1 East
W2 West
S4 South
Here is my statement
SELECT S.SALESPERSON_REGION_ID, COUNT(S.SALESPERSON_REGION_ID),
SALESPERSON_REGION_DESCRIP
FROM SALESPERSON AS S, SALESPERSON_REGION AS SR
WHERE S.SALESPERSON_REGION_ID = SR.SALESPERSON_REGION_ID
GROUP BY S.SALESPERSON_REGION_ID;
ERROR message:
SELECT S.SALESPERSON_REGION_ID, COUNT(S.SALESPERSON_REGION_ID),
*
ERROR at line 1:
OCA-30021: error preparing/executing SQL statement
[[POL-5235]] not a GROUP BY expression
I thought I did everything right. =( Thanx
|
|
|
|
|