title: how to use the order by and aggregate function together in sql query
body: <pre><code>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
  </code></pre>
  
  <p>this shows me the error :</p>
  
  <blockquote>
    <p>Column
    'RequirementsDetailsforOrganization.RequirementID'
    is invalid in the select list because
    it is not contained in either an
    aggregate function or the GROUP BY
    clause.</p>
  </blockquote>
  
  <p>how to do the 'order by org.RegisteredDate desc' in this Query ....</p>
  
  <p>pls help me out.....??????</p>