I have the following table in MYSQL database (table doesn't exactly match the example).
ID value Percentage
AA A1 100
AA A2 80
AA A3 80
AA A4 90
AA B1 100
AA B2 55
AA B3 100
AA B4 100
BB A1 100
BB A2 50
BB A3 50
BB A4 90
BB B1 20
BB B2 90
BB B3 90
BB B4 100
I have to output my data set to the following table.
ID A B
The following rules apply
For each ID I have to check the value that starts with A
I have to check percentages of each value that starts with A. If all percentages are >75 and < 100 then I have to write "W/W" in the output table under A.
If one of the percentages is 50 my output will be "W/<the value whose percentage was 50" for A.
If two or the percentages is 50 my output will be "the value whose percentage was 50 / the other value whose percentage was 50".
if one percentage 0 my output will be "the value whose percentage was 0 / the value whose percentage was 0"
All other cases output will be "F/F"
I want a SQL query (that will run in MYSQL) to do the above.
Its a very easy project. Budget around $15-$30.
The program should run on my data set. It should be flexible enough to table more values for sample ID (as long as the value start with the same character).