I want to group SQL columns. Useful usage is group by. But it is not working. My target data is below. Second picture is my desired table. How do I create second result? How do I write the SQL code? Below is only a sample; don’t focus on id, Name, SurName etc. The important things are Value and Group.

My desired result:

Below my undesired result: Group is string. if al column X0digitdigitdigit format. every thing is ok via order by. but group A0123,A0045, A0003 etc

1 Answer