title: I have an ordered grouped query, how know what is the first field that change over previous register
body: <p>i have a query like this</p>
  
  <pre><code>SELECT FIELD_1, FIELD_2... FIELD_N, SUM(AMOUNT) 
  FROM TABLE 
  GROUP BY FIELD_1, FIELD_2... FIELD_N 
  ORDER BY FIELD_1, FIELD_2... FIELD_N
  </code></pre>
  
  <p>Is there any way to know what's the first field that change over the previous register when i process the query results?</p>
  
  <p>I'm searching for an sql function (it's an Oracle Database) like <code>GROUPING_ID</code>, but that it's only is useful with <code>GROUP BY ROLLUP</code> queries, and i don't want subtotals.</p>
  
  <p>If there is not such function i have to program a manual search, and I want to minimize the access to the result set.</p>