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 8130957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:55:22+00:00 2026-06-06T08:55:22+00:00

In Oracle SQL, how do I return count(*) column along side of a regular

  • 0

In Oracle SQL, how do I return count(*) column along side of a regular column?

What works:

select count(*) from TABLE where username = 'USERNAME';

What I’d like to work:

select username,count(*) from TABLE where username = 'USERNAME';

So I want the username along side of the count, to expand this into another query that lists numerous usernames and the count of their records.

Error:

ORA-00937: not a single-group group function
00937. 00000 -  "not a single-group group function"
*Cause:    
*Action:
Error at Line: 7 Column: 7

Question:

So, how do I do it?

  • 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-06T08:55:27+00:00Added an answer on June 6, 2026 at 8:55 am
    SELECT username,count(*) from TABLE WHERE username='USERNAME' GROUP BY username
    

    should do the trick!

    The reason the first query works is because MySQL can automatically convert that query into an aggregate query, because it “understands” that you want to count all of the rows where username=’USERNAME’. The second query isn’t clear enough – you’re trying to perform an aggregate function on rows selected by the query, but you also want the rows of the query. My query makes it clear that you only expect one username returned out of the set, so aggregation is not a problem.

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

Sidebar

Related Questions

I'm using Oracle SQL Developer. I'd like to key in dates with hours and
I would like to share my Oracle SQL Developer configuration across my several computers
Ok this is the scenario... I have a table in Oracle that acts like
Oracle 8 SQL: I do have data like VTR 564-31 / V16 H12 W08
Is it possible in oracle sql to return a default row if no rows
I'm trying to use a Year-Week format in oracle SQL to return results only
I have a query in Oracle for a report that looks like this: SELECT
I have a hierarchical query in Oracle 10 SQL that used to work. However,
select id,name,amount,sort from (select id,name,amount,sort,gift_id,count(gift_id) from (select * from t_lpw_gift g join t_lpw_dianxin_gift d
What is the Oracle equivalent of SQL Server's SET NOCOUNT ON? From the SQL

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.