title: How to use SUM with DISTINCT function togather
body: <p>Is there any way by which i can SUM(value) of ColA (ColA is repeating in each ROW) based on DISTINCT(value) of ColB?</p>
  <p>My Data Table is:</p>
  <pre><code>+-------+-------+------+--------+
  | State | KEY_ID| Score| STATUS |
  +-------+-------+------+--------+
  |  ABCD |   11  |   20 |   1    |
  |  ABCD |   11  |   30 |   1    |
  |  ABCD |   13  |   40 |   1    |
  |  DEFG |   21  |   10 |   1    |
  |  DEFG |   21  |   25 |   1    |
  |  DEFG |   23  |   15 |   1    |
  +-------+-------+------+--------+
  </code></pre>
  <p>&amp; wanted output like :</p>
  <pre><code>+-------+-------+------+--------+
  | State | KEY_ID| Score| STATUS |
  +-------+-------+------+--------+
  |  ABCD |   11  |   50 |   1    |
  |  ABCD |   13  |   40 |   1    |
  |  DEFG |   21  |   35 |   1    |
  |  DEFG |   23  |   15 |   1    |
  +-------+-------+------+--------+
  </code></pre>
  <p>but not want to use GROUP BY function &amp; OVER() in not working in my MySQL version 8.0.28</p>