sql = "update sort set number = number-1 where id = (select sortId from file where id = ? )";
dbc.prepareStatement(sql);
dbc.setLong(2, id);
if(dbc.executeUpdate() == 0) {
return false;
}
...全文
1648打赏收藏
请教一个SQL嵌套查询语句?
我在DAO层中用下面的嵌套sql语句查询怎么是返回false呢?不懂,请大家帮忙!我在mysql命令行下执行是正确的! file表中的sortId和sort表中的id字段关联。 sql = "update sort set number = number-1 where id = (select sortId from file where id = ? )"; dbc.prepareStatement(sql); dbc.setLong(2, id); if(dbc.executeUpdate