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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:37:07+00:00 2026-05-14T21:37:07+00:00

SELECT count(distinct req.requirementid), req.requirementid, org.organizationid, req.locationofposting, org.registereddate FROM OrganizationRegisteredDetails AS org, RequirementsDetailsforOrganization AS req

  • 0
SELECT
    count(distinct req.requirementid),
    req.requirementid,
    org.organizationid,
    req.locationofposting,
    org.registereddate
FROM OrganizationRegisteredDetails AS org,
    RequirementsDetailsforOrganization AS req
WHERE org.organizationid = req.requirementid
ORDER BY
    org.RegisteredDate desc

this shows me the error :

Column
‘RequirementsDetailsforOrganization.RequirementID’
is invalid in the select list because
it is not contained in either an
aggregate function or the GROUP BY
clause.

how to do the ‘order by org.RegisteredDate desc’ in this Query ….

pls help me out…..??????

  • 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-14T21:37:07+00:00Added an answer on May 14, 2026 at 9:37 pm

    You need to add all columns referenced in the SELECT list or in the ORDER BY into a GROUP BY clause.

    SELECT 
        count(distinct req.requirementid), 
        req.requirementid, 
        org.organizationid, 
        req.locationofposting, 
        org.registereddate 
    FROM OrganizationRegisteredDetails AS org, 
        RequirementsDetailsforOrganization AS req 
    WHERE org.organizationid = req.requirementid 
    GROUP BY
        req.requirementid, 
        org.organizationid, 
        req.locationofposting, 
        org.registereddate 
    ORDER BY 
        org.RegisteredDate desc 
    

    Although in this case, you’ll only get the value 1 in the first column in all rows since you’re grouping on req.requirementid!

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

Sidebar

Related Questions

I have a mysql query like this: $topicreplycount = mysql_query('SELECT COUNT(DISTINCT post_msg_id) FROM phpbb_attachments
In a statement like this; $sql = SELECT distinct `term`,count(*) as count FROM {$temp_table_name}
I have a query like this: SELECT count(distinct ID) FROM TBLC WHERE date BETWEEN
I had a query like this select count(distinct sessionKey) as tot from visits But
I have this table : select count(distinct clean_deep_link) from tbl_1; +---------------------------------+ | count(distinct clean_deep_link)
How to do this on Google App Engine (Python): SELECT COUNT(DISTINCT user) FROM event
Okay, so I have this T-SQL statement: SELECT COUNT(DISTINCT RentalNo) as Count FROM RoomRental
I am using this query SELECT COUNT(DISTINCT to_number) AS errors FROM sent_txts WHERE msg_link_id
I wonder how to do this with a variable: SELECT Count(distinct UserIP) FROM VisitorIP
I have this query: select pa.id,pa.name from patients pa where (select count(distinct co.doctorID) from

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.