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

  • SEARCH
  • Home
  • 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 8614453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:07:29+00:00 2026-06-12T05:07:29+00:00

I am very new to Oracle, While i am practicing some examples i encountered

  • 0

I am very new to Oracle, While i am practicing some examples i encountered with the problem “invalid character (SQL-HY000)“.

Below are sample table and data that i used for my practice

CREATE TABLE games (
  id INT NOT NULL PRIMARY KEY ,
  city VARCHAR(20),
  name VARCHAR(20)
);     

INSERT INTO games(id,city,name) VALUES (2004,'Athens','football'); 
INSERT INTO games(id,city,name) VALUES (2008,'Beijing','cricket');

SELECT id, COUNT(*) over() as rowcount 
  FROM games g 
 where name='football' 
 GROUP BY CASE 
            WHEN name='football' 
            THEN g.name 
          END;

What is the invalid character in the select statement ?

Any help will be greatly appreciated

  • 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-06-12T05:07:30+00:00Added an answer on June 12, 2026 at 5:07 am

    Because of the CASE within the GROUP BY. Also, GROUP BY is not required, since you are already filtering the football rows in the WHERE clause:

    SELECT id, COUNT(*) OVER() as rowcount 
    FROM games g 
    WHERE name = 'football' 
    

    When you use an analytic function, such as COUNT(*) OVER(), you don’t need to use GROUP BY. They serve different purposes.

    DEMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Excuse me but I am very new at learning to use oracle and sql.
I am very new to Oracle PL/SQL... What is the difference between Oracle Functions,
OK so I'm new to SQL and not very familiar with Oracle SQLDev, but
New to Oracle SQL and I assume that this is a very straight forward
I'm very new to Oracle and was wondering if there's a way either through
I'm very new to oracle but I've been learning about it in class and
Am very new to Oracle triggers. Suppose I have a trigger on an insert
I need to insert many sql rows into oracle database very fast. IndexData is
I am very new to Oracle exploring things,reading about how index access ,i got
Hey all i am VERY new to a Oracle DB and i am trying

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.