The query is:
select sum(value)
from TAB
where TimeStamp=
{
select max(TimeStamp)
from TAB where col1=12 and col2=18
}
and col1=12 and col2=18;
I am trying to improve it by eliminating the sub query if possible.
Try this: