in reply to UPDATE WHERE oid = $oid
# Update oid with new timestamp my $sql = <<"EOT"; update clock set time = ? where oid = ? EOT my $upd_h = $dbh->prepare($sql); $upd_h->execute($new_time, $oid); # Get oid(s) with latest timestamp # This could all be done in one select # with either a subquery or ordering # by descending time, but this is one way # Get max timestamp $sql = <<"EOT"; select max(time) from clock EOT my ($time) = @{$dbh->selectcol_arrayref($sql)}; # Get all oid(s) with max timestamp $sql = <<"EOT"; select oid from clock where time = ? EOT my (@oids) = @{$dbh->selectcol_arrayref($sql, {}, $time);
|
|---|