我在表格中有四列。我正在使用sqlite数据库,我想删除三列数据并保留其他一列的数据。
String sql="DELETE january,deducted,remaining FROM sailary where id=?";
try
{
pst = conn.prepareStatement (sql);
pst.setString (1, jut.getText());
pst.execute();
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e);
}
答案 0 :(得分:2)
delete
用于删除行。您可以做的是update
这些列在您指的特定行中为null
:
UPDATE sailary
SET january = NULL, deducted = NULL, remaining = NULL
WHERE id = ?