Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Count(*) with group by and a join

parsarMar 25 2013 — edited Mar 25 2013
I've the below tables:

Tables:
EMPLOYEE 
EMP_ID	    LNAME	        FNAME
1000	            SLITT	         JOHN
1001	            SLITHER	         STEVE
1002	            JACOB	         MARLYN
1003	            STUFFEY	NOSE
1004	            SLIPPY	         MOUTH
-----
ACCESS_TYPE
ACCESS_TYPE_ID	ACCESS_DESCRIPTION
1				     EMPLOYEE
2				     EMPLOYEE_ADMIN
3				     CONTRACTOR
-----
EMPLOYEE_ACCESS
ACCESS_ID	 ACCESS_TYPE_ID	EMP_ID     ACCESS_EFF_DATE	
1			1			1000	         01-JAN-13
2			1			1001	         10-FEB-13
3			1			1002	         18-FEB-13
4			2			1003	         10-OCT-12
5			3			1004	         10-MAR-08
-----
I'm trying to figure out the count of employees group by their type and whose last name does not start with SL
I've written the query below and I'm getting a 00936 Missing Expression. What am I doing wrong? Thanks

SELECT EA.COUNT(*) , ACCESS_TYPE_ID
FROM EMPLOYEE_ACCESS EA, EMPLOYEE E
WHERE ACCESS_EFF_DATE >= '31-DEC-12' AND E.LNAME NOT LIKE 'SL%'
GROUP BY ACCESS_TYPE_ID;

Edited by: parsar on Mar 25, 2013 3:54 PM
This post has been answered by unknown-7404 on Mar 25 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2013
Added on Mar 25 2013
8 comments
840 views