Link to home
Start Free TrialLog in
Avatar of Allen Pitts
Allen PittsFlag for United States of America

asked on

PL/SQlL All the rows that have only one of the same value in as certain field

Hello expert,

Need to find the rows in a table that only have a value once in the
 parent_company_id field.

Tried
SELECT employer_id,
   employer_name,
  employer_category_code,
   parent_company_id,
  alternate_name
from ccm_employer
GROUP BY  parent_company_id, employer_id
HAVING COUNT(*) > 1

But it returns

ORA-00979: not a GROUP BY expression
00979. 00000 -  "not a GROUP BY expression"
*Cause:    
*Action:
Error at Line: 2 Column: 3

How can I get the needed result?

Thanks.

Allen in Dallas
SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial