繁体   English   中英

有没有更快的方法来编写这三个相同的查询?

[英]Is there a faster way to write those 3 same queries?

有没有更快的查询方式可以重写或合并这些查询?

update products
set shop = '1' 
where shop LIKE '%demo%'

update products
set shop = '2' 
where shop LIKE '%car%'

update products
set shop = '3' 
where shop LIKE '%art%'
update products
set shop =
case 
when shop like '%demo%' then 1
when shop like '%car%' then 2
when shop like '%art%' then 3
else shop
end

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM