I have the below sample table and I need a second table without duplicate grouped values from column 'Values'
+----+--------+
| Id | Values |
+----+--------+
| 1 | A |
| 2 | B |
| 3 | B | <--remove
| 4 | A |
| 5 | A | <--remove
| 6 | A | <--remove
| 7 | B |
| 8 | A |
| 9 | A | <--remove
| 11 | B |
| 12 | B | <--remove
| 13 | B | <--remove
| 14 | B | <--remove
| 15 | C |
+----+--------+
The result table must be:
+----+--------+
| Id | Values |
+----+--------+
| 1 | A |
| 2 | B |
| 4 | A |
| 7 | B |
| 8 | A |
| 11 | B |
| 15 | C |
+----+--------+
I've been trying with GROUP BY, DISTINCT, and ROW_NUMBER() statements without success. I can't figure out how construct a working SQL query.
LAG()
: stackoverflow.com/a/49077394/2055998