SHARE
TWEET

Untitled

a guest Jul 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- 查询两个表差集
  2. SELECT actual_get_no,polno
  3. FROM (
  4.     SELECT t.actual_get_no,t.polno FROM tmp t
  5.     UNION ALL
  6.     SELECT tr.actual_get_no,tr.polno FROM tmp_right tr
  7. ) tbl
  8. GROUP BY actual_get_no, polno
  9. HAVING count(*) = 1;
  10.  
  11. -- 通过索引可以强制删除重复数据
  12. alter IGNORE table supplier_protocol_risk_fee_rate
  13.     add unique index uk_sup_risk_fee_rate (protocol_no, risk_code, pay_way, lower_policy_year, upper_policy_year,
  14.                                            lower_pay_year,
  15.                                            upper_pay_year);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top