title: How to create changing group identifier in MariaDB
body: <p>I have a table in my MariaDb which looks like the following table and need to create the "group" column (see output).
  The group changes if the combination of KEY_A and KEY_B changes in the order of LOAD_DATE (see output).
  I'm not able to find a proper SQL to generate the "group" column. </p>
  
  <p>Maybe someone has an idea  how to solve this in MariaDB? </p>
  
  <p>TestData:</p>
  
  <pre><code>CREATE OR REPLACE TABLE test AS 
  SELECT 'AAA' AS KEY_A,'A' AS KEY_B,DATE('2010-01-01') AS LOAD_DATE
  UNION
  SELECT 'AAA' AS KEY_A,'B' AS KEY_B,DATE('2010-01-02') 
  UNION
  SELECT 'AAA' AS KEY_A,'A' AS KEY_B,DATE('2010-01-03') 
  UNION
  SELECT 'AAA' AS KEY_A,'A' AS KEY_B,DATE('2010-01-04') 
  UNION
  SELECT 'BBB' AS KEY_A,'C' AS KEY_B,DATE('2010-01-04') 
  UNION
  SELECT 'CCC' AS KEY_A,'D' AS KEY_B,DATE('2010-01-04') ;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>KEY_A; KEY_B; LOAD_DATE;  group
  
  AAA;   A;     2010-01-01;  1
  AAA;   B;     2010-01-02;  2
  AAA;   A;     2010-01-03;  3
  AAA;   A;     2010-01-04;  3
  BBB;   C;     2010-01-04;  1
  CCC;   D;     2010-01-04;  1
  
  </code></pre>