日期:2014-05-17  浏览次数:20412 次

设定某个值为另外一个值的最后一位数字


本人只会比较粗糙的sql语句。。。

tid尾数为1的时候=1
tid尾数为2的时候=2
……
tid尾数为0的时候=0
------解决方案--------------------
没有mysql的环境,如果还报错,试一下用这个:
update pre_forum_attachment set tableid=case right(tid ,1) when 1 then 1 when 2 then 2  when 3 then 3 when 4 then 4 when 5 then 5 when 6 then 6 when 7 then 7 when 8 then 8 when 9 then 9 when 0 then 0 ELSE 0  end