title: Oracle sql group by then sort
body: <p>I'm trying to split my query results into 2 groups, ones that have a flag of Y and ones that have a flag N. I then need to sort the groups by the based on 2 things.</p>
  
  <p>Here's the query I've tried which doesn't work with the GROUP BY bit:</p>
  
  <pre><code>SELECT      location, 
          country 
  FROM        web_loc_info 
  WHERE       flag = 'Y' 
  OR      flag = 'N' 
  AND         available_online = 'Y' 
  GROUP BY    flag 
  ORDER BY    country, 
                  location_desc
  </code></pre>
  
  <p>Any help with this would be great so thanks in advance for any replies</p>