, . . ( sqlite, , , SQL-92 , , .)
1: , . , , , -NULL BackupTime. (, BackupTime, , , BackupDate . , .)
2. , :
update Items i set
BackupTime = (
select min(BackupTime)
from Items d
where d.ParentId = i.ItemId
)
where i.Type = 1
and i.BackupTime is null
and not exists (
select *
from Items d
where d.ParentId = i.ItemId
and d.Type = 1
and d.BackupTime is null
)
, BackupTime , , : BackupTime null, , BackupTime .
, , , BackupTime , , . BackupTime , , -.
, , BackupTime ((select...), current_timestamp).