Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: UPDATE WHERE oid = $oid

by Wookie (Beadle)
on Jul 20, 2001 at 01:17 UTC ( [id://98242]=note: print w/replies, xml ) Need Help??


in reply to UPDATE WHERE oid = $oid

This is a terrible hack way to do it - but you could reduce it to one select by:
$sql='select oid,time'; $sql.='from clock'; $sql.='order by time'; $exec=$dbh->prepare($sql); $exec=$dbh->execute()||die "Query Failed\n$sql\nError:\n$DBI::errstr"; while ($res=$exec->fetch) { $latest_oid=${$res}[0]; }
As the last record to come off this query should be the one with the latest time stamp - $latest_oid will have the corresponding oid.
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Replies are listed 'Best First'.
Re: Re: UPDATE WHERE oid = $oid
by runrig (Abbot) on Jul 20, 2001 at 01:26 UTC
    You can order by 'time desc' and then the first oid's will be the ones with the latest timestamp.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://98242]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2025-03-17 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (54 votes). Check out past polls.