I have the following table:
oSerial oDateTime oMessage1
--------------------------------------------------
123456 2022-01-01 08:00:00 F1F
123456 2022-01-01 08:10:00 F2F
123456 2022-01-01 08:45:00 F5F
123456 2022-01-01 09:05:00 F1N
I want to have the following result:
oSerial oDateTime F1 F2 F3 F4 F5
--------------------------------------------------------------------
123456 2022-01-01 08:00:00 RED
123456 2022-01-01 08:10:00 RED
123456 2022-01-01 08:45:00 RED
123456 2022-01-01 09:05:00 GREEN
So, if the last character under oMessage1
is F, then the value should be RED
. If the last character under oMessage1
is N, then the value should GREEN
. The value will be placed under F1 - F5 column based on 2 characters in the beginning under oMessage1.
Any advice? Really appreciated.
Thank you.