update adplan
set haveshowtimes=v.count_advlog
from v_my_countadvisitloglist v,adplan a
where v.adid=a.adid
and v.cppgtypeid=a.cppgtypeid
提示错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from v_my_countadvisitloglist v,adplan a
where v.adid=a.adid
and v.cppgtypeid=a.' at line 3
不好意思 摸索了半天
原因找到
是语法问题 sqlserver 2000大概是sql92语法支持如下
select * from adplaninfo where cpid like '%|'+0+'|%
但是mysql不支持
提错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from adplaninfo where cpid like '%'+@CPID+'%'
end; //' at line 4
mysql 支持模糊查询
select * from adplaninfo where cpid like '%|0|%
但是不支持
select * from adplaninfo where cpid like '%|'+0+'|%