update与select中的case when ... then,添加行号用于分页

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

update test1 set name = case 
when name = 'n' then '你'
when name = 'h' then '好'
when name = 'm' then '吗'
else '你好吗'
end 

 

 

select id,case 
when name = '你' then 'ni'
when name = '好' then 'hao'
when name = '么' then 'me'
else 'nihaome'
end,count(*)
from test group by id,name 

 

 

select *,row_number() over(order by anniversary desc) from test1 

 

select name from sys.columns where object_id=object_id('Log_Erro') --查询表中列

转载于:https://my.oschina.net/u/3141521/blog/1800121

你可能感兴趣的:(update与select中的case when ... then,添加行号用于分页)