Skip to content
Advertisement

How i want make 3 rows of the same primary key into 1 row by checking and choose its value using case

For example here, from this table

the hierarchy will be C>D>A

If the the stats contain C as the value, the person status will become C in one row. It will be like this:

it will ignore D and A because it has value C. If it doesn’t has C,then it will check for D first before A. So, how can i do that? I dont how to make the 3 row into 1. I tried using

But it give error and still can’t make the row into 1

Advertisement

Answer

You can try the below –

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