日期:2014-05-20  浏览次数:20585 次

请问一个sql更新语句
请问我在java程序中设置了两个复选框,一个表示真che1,一个表示假che2,当选中表示真的复选框时数据库中的相应字段tf更新为1,选中表示假的复选框时相应字段tf变为更新为0,用update语句怎么写

------解决方案--------------------
update 表名 set 列名={0,1}~~~
------解决方案--------------------
update table set tf=
case when che1.checked then 1else 0 end

你試一下看行不行的