The basic idea behind what I'm trying to do is --
update bits of 'reporta' by setting it to the sum of bits of 'reporta' and 'reportb' where the timestamps of reporta and reportb match. The bits of reportb should remain untouched.
Here's what I'm trying - I understand why it's not working but can't figure out how to resolve my problem.
update table1
set bits =
(select sum(bits)
from table1
where
report_id in (select report_id from table1
where report_id in ('reporta','reportb'))
and timestamp = timestamp)
and report_id = 'reporta'
Any help that can point me in the right direction would be greatly apprecited.
update bits of 'reporta' by setting it to the sum of bits of 'reporta' and 'reportb' where the timestamps of reporta and reportb match. The bits of reportb should remain untouched.
Here's what I'm trying - I understand why it's not working but can't figure out how to resolve my problem.
update table1
set bits =
(select sum(bits)
from table1
where
report_id in (select report_id from table1
where report_id in ('reporta','reportb'))
and timestamp = timestamp)
and report_id = 'reporta'
Any help that can point me in the right direction would be greatly apprecited.