title: 'ora-00979'(not a group by expression) caused by 'order by'
body: <p>I'm sorry for my poor English,but I will try my best to describe my question</p>
  
  <pre><code>SELECT user_id,
         Count(user_id),
         Trunc(created_time, 'dd')
  FROM   (SELECT user_id,
                 created_time
          FROM   t_vote_join_user
          WHERE  created_time &gt;= To_date('20120720', 'yyyymmdd')
                 AND created_time &lt; To_date('20120814', 'yyyymmdd')
                 AND ( ( vote_id = 1270
                         AND options = '["5526"]' )
                        OR ( vote_id = 1306
                             AND options = '["5666"]' )
                        OR ( vote_id = 1320
                             AND options = '["5759"]' )
                        OR ( vote_id = 1366
                             AND options = '["5966"]' )
                        OR ( vote_id = 1393
                             AND options = '["6066"]' )
                        OR ( vote_id = 1432
                             AND options = '["6203"]' )
                        OR ( vote_id = 1452
                             AND options = '["6269"]' )
                        OR ( vote_id = 1502
                             AND options = '["6482"]' )
                        OR ( vote_id = 1610
                             AND options = '["6863"]' )
                        OR ( vote_id = 1627
                             AND options = '["6917"]' )
                        OR ( vote_id = 1651
                             AND options = '["7010"]' )
                        OR ( vote_id = 1676
                             AND options = '["7098"]' ) ))
  GROUP  BY user_id,
            Trunc(created_time, 'dd')
  ORDER  BY Trunc(created_time, 'dd')
  </code></pre>
  
  <blockquote>
    <p>executed error caused by ora-00979(not a group by expression),but
    executed ok without 'order by TRUNC(created_time, 'dd')'</p>
  </blockquote>