本帖最后由 csdroot 于 2014-09-28 17:29:06 编辑

解决方案 »

  1.   

    update  tab1 set  b  = if( b>1,99,0)  where a = 286
      

  2.   

     
    如果想要在  if( )中增加查询条件 ,比如若select  if(tab1.n>tab2.n ,tab1.n,tab2.n  )  from tab1,tab2 where tab1.id=tab2.id  怎么做 如果只直接写会报错  update  tab1 g   join  回报警告
      

  3.   

    update tab1 a , (select  if( b>1,99,0) b  from tab1) b
    set a.a=b.b
    where a.a=b.a
    and a.a=286
      

  4.   

     提示一个警告  可以但是为什么  工具回报一个警告? 是工具的问题?
     mysql 是5.6 数据库是 myisam  的引擎