10 个解决方案
#1
update bank set beizhu ='新开户' from bank where price in (2,8)
#2
我是想查询的时候修改,不需要修改数据库中的值 只是查询展示用而已
#3
select price,case when beizhu = 2 or beizhu = 8 then '新开户' else beizhu end as beizhu from bank
#4
select price, case when price in(2,8) then beizhu=‘新开户’ else beizhu end as beizhu from bank
#5
谢谢
select case when price in ('0', '10') then '已存档' else beizhu end as 'ss ' from dbo.bank;
#6
select price,
case when price= 2 or price=8 then '新开户' else beizhu end as beizhu
from bank
#7
update
set beizhu='新开户'
from bank
where price in (2,8)
#8
select
price,
case price
when 2 then '新开户',
when 8 then '新开户',
else beizhu
end as 'beizhu'
from bank
#9
上面多写了逗号
#10
如果是查询:
select price,case when price IN (2,8)
then '新开户'
else beizhu
end beizhu
from bank
如果是更新:
update bank
set beizhu = '新开户'
where price IN (2,8)
select price,case when price IN (2,8)
then '新开户'
else beizhu
end beizhu
from bank
如果是更新:
update bank
set beizhu = '新开户'
where price IN (2,8)
#1
update bank set beizhu ='新开户' from bank where price in (2,8)
#2
我是想查询的时候修改,不需要修改数据库中的值 只是查询展示用而已
#3
select price,case when beizhu = 2 or beizhu = 8 then '新开户' else beizhu end as beizhu from bank
#4
select price, case when price in(2,8) then beizhu=‘新开户’ else beizhu end as beizhu from bank
#5
谢谢
select case when price in ('0', '10') then '已存档' else beizhu end as 'ss ' from dbo.bank;
#6
select price,
case when price= 2 or price=8 then '新开户' else beizhu end as beizhu
from bank
#7
update
set beizhu='新开户'
from bank
where price in (2,8)
#8
select
price,
case price
when 2 then '新开户',
when 8 then '新开户',
else beizhu
end as 'beizhu'
from bank
#9
上面多写了逗号
#10
如果是查询:
select price,case when price IN (2,8)
then '新开户'
else beizhu
end beizhu
from bank
如果是更新:
update bank
set beizhu = '新开户'
where price IN (2,8)
select price,case when price IN (2,8)
then '新开户'
else beizhu
end beizhu
from bank
如果是更新:
update bank
set beizhu = '新开户'
where price IN (2,8)