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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:57:09+00:00 2026-06-12T00:57:09+00:00

I have a table like this column1 column2 column3 abc xyz 4 def ghi

  • 0

I have a table like this

column1 column2 column3

abc      xyz      4
def      ghi      3
abc      xyz      6
abc      xyz      1
jkl      mno      4

Expected Result after query

column1 column2 column3

abc      xyz      11
def      ghi      3
jkl      mno      4

My Query is like below:

select column1, column2, count(column3)
from
    (select ......) as column1, 
    (select ......) as column2, 
    (select ......) as column3) 
group by column1, column2, count(column3)

I get this error “not a single-group group function”

  • 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-12T00:57:11+00:00Added an answer on June 12, 2026 at 12:57 am

    You need to use SUM and you must remove the count(column3) in the group by and if you really get the columns as results from sub-queries it might need to rather look like this:

    select column1, column2, sum(column3) 
    from   (
             select
                 (select ......) as column1, 
                 (select ......) as column2, 
                 (select ......) as column3
               from dual
           )
    group by column1, column2
    

    otherwise you would need to repeat the entirety of the sub-query select in the group by. In your query you say FROM (select .......) as column1 but that means that the subquery is called column1 which does not work. The selected columns in the subquery could be addressed by using the prefix column1. For example if you say FROM (select x from test) t1 then you can address x by writing t1.x.

    but if you have a simple table as you describe above the correct statement is

    select   column1, column2, sum(column3) from mytable
    group by column1, column2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this: ID Name Column1 Column2 Column3 1 ABC 202.2
I have a table like this: id products_name sort 1 abc 0 2 xyz
Suppose, I have a table like this- Code | something ------------------ C01 abc C02
Suppose I have this table [Table1] Name Mark ------- ------ ABC 10 DEF 10
I currently have something like this: UPDATE table1 SET column1 = REPLACE(column1, 'abc', 'abc1')
Assume I have a table like this: column A(int) column B(int) 1 2 2
I have a table structure with columns like this [ID] [Name] [ParentId] [ParentName] The
If i have a sql table with column like this id version subversion 1
I have a table I'd like to sort with a priority column. This column
I have a table which looks like this: mysql> SHOW COLUMNS FROM Users; +------------+--------------+------+-----+---------+----------------+

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.