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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:39:53+00:00 2026-06-06T16:39:53+00:00

I have an application that uses Hibernate. It generated the following SQL statement. I

  • 0

I have an application that uses Hibernate. It generated the following SQL statement. I am trying to modify the query to group the data but I keep getting an error

ORA-00979: not a GROUP BY expression

The query

>  select
>         snstoken0_.id as id20_0_,
>         snstokenme1_.SNS_MESSAGE_ID as SNS2_21_1_,
>         snstokenme1_.SNS_TOKEN_ID as SNS3_21_1_,
>         snsmessage2_.id as id19_2_,
>         snsmaster3_.id as id17_3_,
>         snstokenpr4_.id as id22_4_,
>         snstoken0_.ACTIVE_STATE as ACTIVE2_20_0_,
>         snstoken0_.MEMBER_ID as MEMBER8_20_0_,
>         snstoken0_.SNS_MASTER_ID as SNS9_20_0_,
>         snstoken0_.TOKEN1 as TOKEN3_20_0_,
>         snstoken0_.TOKEN2 as TOKEN4_20_0_,
>         snstoken0_.TOKEN3 as TOKEN5_20_0_,
>         snstoken0_.DATE_TOKEN as DATE6_20_0_,
>         snstoken0_.USERNAME as USERNAME20_0_,
>         snstokenme1_.ARTICLE_ID as ARTICLE1_21_1_,
>         snstokenme1_.SNS_TOKEN_ID as SNS3_20_0__,
>         snstokenme1_.SNS_MESSAGE_ID as SNS2_0__,
>         snstokenme1_.SNS_TOKEN_ID as SNS3_0__,
>         snsmessage2_.ACTIVE_STATE as ACTIVE2_19_2_,
>         snsmessage2_.CONTENT_ID as CONTENT5_19_2_,
>         snsmessage2_.MESSAGE_TEXT as MESSAGE3_19_2_,
>         snsmessage2_.SNS_MESSAGE_ID as SNS6_19_2_,
>         snsmessage2_.POST_DATE as POST4_19_2_,
>         snsmaster3_.ACTIVE_STATE as ACTIVE2_17_3_,
>         snsmaster3_.ACTIVE_ICON as ACTIVE3_17_3_,
>         snsmaster3_.AUTHENTICATION_URL as AUTHENTI4_17_3_,
>         snsmaster3_.BREAK_TOKEN_URL as BREAK5_17_3_,
>         snsmaster3_.INACTIVE_ICON as INACTIVE6_17_3_,
>         snsmaster3_.NAME as NAME17_3_,
>         snsmaster3_.URL_WEBSITE as URL8_17_3_,
>         snstokenpr4_.ACTIVE_STATE as ACTIVE2_22_4_,
>         snstokenpr4_.SNS_TOKEN_ID as SNS5_22_4_,
>         snstokenpr4_.VALUE as VALUE22_4_,
>         snstokenpr4_.VAR as VAR22_4_,
>         snstokenpr4_.SNS_TOKEN_ID as SNS5_20_1__,
>         snstokenpr4_.id as id1__ 
>     from
>         SNS_TOKEN snstoken0_ 
>     left outer join
>         SNS_TOKEN_MESSAGE snstokenme1_ 
>             on snstoken0_.id=snstokenme1_.SNS_TOKEN_ID 
>     left outer join
>         SNS_MESSAGE snsmessage2_ 
>             on snstokenme1_.SNS_MESSAGE_ID=snsmessage2_.id 
>     left outer join
>         SNS_MASTER snsmaster3_ 
>             on snstoken0_.SNS_MASTER_ID=snsmaster3_.id 
>     left outer join
>         SNS_TOKEN_PROP snstokenpr4_ 
>             on snstoken0_.id=snstokenpr4_.SNS_TOKEN_ID 
>     group by
>         snstoken0_.MEMBER_ID
>     having
>         snstokenpr4_.VAR='PROFILE_IMAGE'
  • 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-06T16:39:54+00:00Added an answer on June 6, 2026 at 4:39 pm

    If you give a GROUP BY clause in your query, it MUST include all non-aggregate expressions in the SELECT list (aside from a few exceptions for literals and some deterministic functions).

    In your case, you need to repeat the entire expression list (following the SELECT) after the GROUP BY.

    (If this is being produced by Hibernate, then Hibernate is producing SQL that is invalid for Oracle.)

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

Sidebar

Related Questions

I have an application that uses hibernate. At one part I am trying to
I have an application that uses hibernate. I did the following: Used List to
I have a web application that uses spring and hibernate for JPA support, but
We have an application that uses Hibernate's 2nd level caching to avoid database hits.
I have an application that uses Hibernate for its domain objects. One part of
I have an application that uses Core Data that has a relationship that I
I have a client application that connects to a server. The server uses hibernate
I have an application that uses hibernate and JPA to handle the database. I
I have a JPA/Spring application that uses Hibernate as the JPA provider. In one
I have a stand-alone, Swing application that uses Hibernate for its persistence layer. I

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.