使用位条件更新查询 [英] Update query using bit condition

查看:58
本文介绍了使用位条件更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果传递的位为true,我必须更新带有''y'的列,如果传递的位是false,则必须为空





可以使用两个更新查询吗?



请帮助

i have to update a column with ''y'' if the bit passed is true and with empty if the bit passed is false


can i use two update query will it work?

please help

推荐答案

Something喜欢

Something like
update table set flag = (select case when bit = true then 'Y' else 'N')


这篇关于使用位条件更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆