呵呵,up也有分。我把语句改了一下,但不满足子查询只能返回单个值的要求。g = "select 交款记录.* from 交款记录 where 累交定金 <(select MAX(累交定金) from 交款记录 where 交款记录.销售编号= '" & f & "'group by 累交定金)"

解决方案 »

  1.   

    你的是什么意思,还不如直接用delete语句
      

  2.   

    select ta.* 
    from 交款记录 ta, 交款记录 tb 
    where ta.累交定金 < 
         (select MAX(tb.累交定金)  
          from tb 
          where tb.销售编号= '" & f & "'") 
      

  3.   

    BenBenBoy(独孤小新) ,用你的方法会提示“对象名 tb 无效”
      

  4.   

    改成以下
    g = "select 交款记录.* from 交款记录 where 累交定金 < MAX(select 累交定金 from 交款记录 where 交款记录.销售编号= '" & f & "') group by 累交定金"
    adors.Open g, adoconn, adOpenKeyset, adLockOptimistic
         If adors.RecordCount > 0 Then
         adors.Delete
         adors.Requery 
         End If
      

  5.   

    再改成以下
    g = "select 交款记录.* from 交款记录 where 累交定金 < MAX(select 累交定金 from 交款记录 where 交款记录.销售编号= '" & f & "' group by 累交定金"
    )