永发信息网

超难问题sql查询:字符串比较。

答案:1  悬赏:20  手机版
解决时间 2021-01-25 10:47
  • 提问者网友:难遇难求
  • 2021-01-25 03:07
超难问题sql查询:字符串比较。
最佳答案
  • 五星知识达人网友:人類模型
  • 2021-01-25 03:41
select id,da,
(case flag1+flag2 when 0 then 0 when 10 then 2 when 11 then 5 else 0 end) as df
from (
select a.id,a.da,case when b.fz is null then 0 else 1 end as flag1,
case when c.fz is null then 0 else 10 end as flag2
from table1 a
left join table2 b on a.id=b.id and a.da=b.ckda
left join table2 c on a.id=b.id and charindex(substring(a.da,1,1),c.ckda)<>0
) t
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯