Skip to content
Advertisement

SQL Result showing same value only once

maybe a simple question I am just not finding an answer for. Im having an MySQL result like

I want it to output the following:

How can I do that? When using GROUP BY he still shows all “A”s in the first column, I want to be shown only once at first occurence.

Thanks in advance!

Advertisement

Answer

Use a CASE expression with NOT EXISTS:

See the demo.
Results:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement