Please let me know if there is a simple way to do this. I've come up with a way, but it is terribly inefficient and this needs to run quick.
GROUP_ID REGISTER_ID READ_VALUE TIMEST
---------- ----------- ---------- -----------------------------
2 1 0.035 01/01/2015 00:00:00.000000000
2 0.035
3 1 1.11 07/14/2015 14:50:32.943000000
3 2 222 01/01/0001 13:36:47.017436000
3 223.11
So what I need is for everywhere REGISTER_ID is NULL, I need the value of TIMEST to be the TIMEST of the MAX(READ_VALUE) for that GROUP_ID (not including the rows where REGISTER_ID is NULL). So the result would look like this:
GROUP_ID REGISTER_ID READ_VALUE TIMEST
---------- ----------- ---------- -----------------------------
2 1 0.035 01/01/2015 00:00:00.000000000
2 0.035 01/01/2015 00:00:00.000000000
3 1 1.11 07/14/2015 14:50:32.943000000
3 2 222 01/01/0001 13:36:47.017436000
3 223.11 01/01/0001 13:36:47.017436000
Anyone have any thoughts?