zoukankan      html  css  js  c++  java
  • 一个数据去重sql

    参考:

    https://www.jb51.net/article/129656.htm

    DELETE testcase
    FROM
     testcase,
     (
      SELECT
      max(id) id,
      api_purpose,
    api_host,
    request_url,
      request_data,
    assert_method,
    check_point,
    correlation,
    active,
    creater
      FROM
       testcase
      GROUP BY
      api_purpose,
    api_host,
    request_url,
      request_data,
    assert_method,
    check_point,
    correlation,
    active,
    creater
      HAVING
       count(*) > 1
     ) t2
    WHERE
     testcase.api_purpose = t2.api_purpose
     and testcase.api_purpose = t2.api_purpose
     and testcase.api_host = t2.api_host
     and testcase.request_url = t2.request_url
     and testcase.request_data = t2.request_data
     and testcase.assert_method = t2.assert_method
     and testcase.check_point = t2.check_point
     and testcase.correlation = t2.correlation
     and testcase.active = t2.active
     and testcase.creater = t2.creater
     and testcase.id <t2.id;

  • 相关阅读:
    高仿中国银行ATM系统
    第二次冲刺2
    第二轮冲刺1
    本日进度7
    本日进度6
    本日进度5
    本日进度4
    本日进度3
    本日进度2
    本日进度
  • 原文地址:https://www.cnblogs.com/kaerxifa/p/10900661.html
Copyright © 2011-2022 走看看