db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob M <rgmatth...@orcon.net.nz>
Subject Re: Updating the last column in the newest record
Date Thu, 29 Jan 2015 21:47:54 GMT
So......................................

Does the following code seem OK?

// Update Profit/Loss field 

psUpdate = conn.prepareStatement("update TABLE SET PROFIT_LOSS=profit WHERE
(TRADING_DATE + TRADING_TIME) = (SELECT MAX(TRADING_DATE + TRADING_TIME)
from TABLE)");
statements.add(psUpdate);
psUpdate.executeUpdate();

// commit the above transactions
conn.commit();

// end updating Profit 
************************************************************



--
View this message in context: http://apache-database.10148.n7.nabble.com/Updating-the-last-column-in-the-newest-record-tp143710p143719.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Mime
View raw message