Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 527199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:51:25+00:00 2026-05-13T08:51:25+00:00

I am having problems with a line of code. I am trying to create

  • 0

I am having problems with a line of code. I am trying to create a count function for a view that I created. I have done this a bunch of different ways but below is the format that I have most recently used.

CREATE VIEW ERP_REPORT(EVENTNAME, DESCRIPTION, COUNT(RIDERS) AS
SELECT EVENTNAME, RACES.DESCRIPTION, 
       RIDERS_FIRSTNAME||' '||RTRIM(RIDERS_LASTNAME)
FROM EVENTS, RACES, PARTICIPATION, RIDERS
WHERE EVENTS.EVENTID = RACES.EVENTID
AND RACES.RACEID = PARTICIPATION.RACEID
AND RIDERS.RIDERID = PARTICIPATION.RIDERID
ORDER BY RIDERS.RIDERS_LASTNAME, EVENTNAME;

The error I am getting is ORA-00907: missing right parenthesis. The error is at the (COUNT(RIDERS) part of the code. Any ideas how I should tackle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:51:25+00:00Added an answer on May 13, 2026 at 8:51 am

    The list of names in parentheses on line 1 should be the names of the view columns:

    CREATE VIEW ERP_REPORT(EVENTNAME, DESCRIPTION, COUNT(RIDERS) AS ...
    

    You can’t create a column called “COUNT(RIDERS” or even “COUNT(RIDERS)” since a column name may not contain ( or ). This would work:

    CREATE VIEW ERP_REPORT(EVENTNAME, DESCRIPTION, RIDER_FULL_NAME) AS ...
    

    However it appears that you really do want a count of something, though I’m not sure of what. To do that the view definition would have to be something like:

    CREATE VIEW ERP_REPORT(EVENTNAME, DESCRIPTION, RIDER_COUNT) AS
    SELECT EVENTNAME, RACES.DESCRIPTION, COUNT(*)
    FROM EVENTS, RACES, PARTICIPATION, RIDERS
    WHERE EVENTS.EVENTID = RACES.EVENTID
    AND RACES.RACEID = PARTICIPATION.RACEID
    AND RIDERS.RIDERID = PARTICIPATION.RIDERID
    GROUP BY EVENTNAME, DESCRIPTION;
    

    (i.e. the COUNT function goes in the SELECT part, not in the list of column names).

    As an aside, since you are presumably new to Oracle, I would suggest you start using the more modern ANSI join syntax to make your queries clearer:

    ...
    FROM EVENTS
    JOIN RACES ON RACES.EVENTID = EVENTS.EVENTID
    JOIN PARTICIPATION ON PARTICIPATION.RACEID = RACES.RACEID
    JOIN RIDERS ON RIDERS.RIDERID = PARTICIPATION.RIDERID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a little problem with the following: When I execute this line: echo
Im having problems displaying records to my view when passing viewdata to a user
I have recently started having problems with TortoiseCVS, or more specifically with plink, the
I'm having problems using textures that are larger than the OpenGL window or the
I am having problems manually looping through xml data that is received via an
I'm having a rather strange problem with MySQL. Trying to create a procedure to
I'm trying to use HTTPWebRequest to access a web service, and am having problems
I'm having problem in the following line: rd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman; it throws an exception
Im having problems building a query with the linq to sql data query expression
I'm having problems deciding on what is the best way is to handle and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.