update table1 set a=19 where a in (select top 1 from table1 order by b)

解决方案 »

  1.   

    update table1 set a=19 having b=max(b)
      

  2.   

    to  52juanjuan(Fibona) :
    update try1 set id =19 where id in (select top 1 from try1 order by no);
     parser: parse error at or near "1" at character 48
    to  hahawen(变态的大龄青年):
    update try1 set id =19 having no=max(no);
    ERROR:  parser: parse error at or near "having" at character 24
      

  3.   

    update table1 set a=19 where a in (select max(b) from table1)
      

  4.   

    update try1 set id =19 where id in (select top 1 id  from try1 order by no);
      

  5.   

    少写了一个或者改成:
    update try1 set id =19 where id in (select top 1 * from try1 order by no);
      

  6.   

    update try1 set id =19 where id in (select top 1 * from try1 order by no);
      

  7.   

    MySQL哪来的Top 1的语法?
    update table1 set a=19 where a in (select a from table1 order by b desc Limit 1)
      

  8.   

    开玩笑,明知不可为而为之!
    mysql不支持子查询,所以你的要求不能在mysql中实现。请换用支持子查询的数据库