我在表帐户中有一个列,我已将其定义为双列。我想更新我正在调用的字段account_balance。
这是我的代码
Query theQuery2 = currentSession.createSQLQuery("update account set account_balance =
(select account_balance from account where telephone_number = ?4 AND nid_number = ?5) + ?6 where telephone_number = ?4 AND nid_number = ?5") ;
theQuery2.setParameter(6, the_loss);
theQuery2.setParameter(5, nid_number);
theQuery2.setParameter(4, telephone_number);
theQuery2.executeUpdate();
这是mysql查询
update account
set account_balance = (select account_balance where telephone_number = ?4 AND nid_number = ?5) + ?6
我怎么能有这个查询
(select account_balance where telephone_number = ?4 AND nid_number = ?5)
给我一个类型的值,double以便我添加准备好的值?6,它是 java 中的 double 类型?。
繁星点点滴滴
相关分类