这是mssql语句,运行是没问题的:
update tb01 set fgl=convert(varchar,id)+'|'+fl 如何这句转成mysql的?我的意思是把id这个int型的转成字符型varchar,然后加上|号,再加fl字段的值,并将此值赋给fglmssql是没有问题的,mysql不行,主要不是id转换方面,而是字符连接方面的问题谢谢!

解决方案 »

  1.   

    udpate tb01 set fgl=concat(cast(id as varchar),'|',fl)
      

  2.   

    update tb01 set fgl=concat(cast(id as char(10)),'|',f1);
      

  3.   

    update tb01 set fgl=concat(id,,'|',fl);
      

  4.   

    报错,提示:aq.executeUpdate:you hava an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near 'varchar),'|',fl) at line 1
      

  5.   

    搞定了,vipper23的可以,不知道为什么要是char型的