insert into b (select * from a join b on a.id=b.id where a.field>b.field)

解决方案 »

  1.   

    怎么选出a表中某个字段值(aa)最大的纪录:
    我这样写,但是报错
    select * from a where a.aa=max(a.aa)
      

  2.   

    这样select  *  from  a  where  a.aa  = (select  max(a.aa) from  a) 或则
    select  *  from  a  where  a.aa  in  (select  max(a.aa) from  a)
      

  3.   

    这样select  *  from  a  where  a.aa  = (select  max(a.aa) from  a) 或则
    select  *  from  a  where  a.aa  in  (select  max(a.aa) from  a)
      

  4.   

    insert into b 
      (select * from a, (select max(aa) as m_aa from a) as b 
         where a.aa = b.m_aa)
      

  5.   

    insert into b(要插入的字段,,,,) values(select  max(a.aa) from a, ,,)