with ADOQuery1 do
    begin
      close;
      sql.Clear;
      sql.Add( 'sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   (select min(sjbh),max(sjbh) from CXGZ where sjbh like '12%' ) ');
      open;

解决方案 »

  1.   

    sql.Add( 'sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   (select min(sjbh),max(sjbh) from CXGZ where sjbh like '12%' ) ');
    什么意思啊,语法都不对阿,你想做什么
      

  2.   

    sql.Add( 'sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   (select min(sjbh),max(sjbh) from CXGZ where sjbh like ''12%'' ) ');
      

  3.   

    sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   (select min(sjbh),max(sjbh) from CXGZ where sjbh like '12%' 
    有这样的语句么?
      

  4.   

    with ADOQuery1 do
        begin
          close;
          sql.Clear;
          sql.Add( 'sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   (select min(sjbh),max(sjbh) from CXGZ where sjbh like ''12%'') ');
          open;
      

  5.   

    写错了   应该是:
        sql.Add( 'update sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   (select min(sjbh),max(sjbh) from CXGZ where sjbh like ''12%'') ');
          
      

  6.   


    在SQL Server 查询分析器中写下面的语句出错:出错提示是:服务器: 消息 208,级别 16,状态 1,行 1
    对象名 'sjtj' 无效。
    是什么原因?update sjtj set  sjks=cxgc_c2.imin, sjjx=cxgc_c2.imax from  sjtj   
    select min(sjbh),max(sjbh) from CXGZ where sjbh like '12%'