Advertisement
aadddrr

Untitled

Sep 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DELETE FROM m_warranty_type_for_sell_price_so Z
  2.     WHERE EXISTS (
  3.         SELECT TRUE
  4.             FROM ul_warranty_type_for_sell_price_so A
  5.             INNER JOIN ul_header B
  6.                 ON B.ul_header_id=A.ul_header_id
  7.             INNER JOIN t_ou D
  8.                 ON A.ou_code = D.ou_code AND B.tenant_id = D.tenant_id
  9.             INNER JOIN m_product E
  10.                 ON A.product_code = E.product_code AND B.tenant_id = E.tenant_id
  11.             INNER JOIN t_combo_value F
  12.                 ON F.combo_id = vPriceLevelComboId AND F.prop_key = A.price_level
  13.             INNER JOIN m_sell_price_product_for_so G
  14.                 ON B.tenant_id=G.tenant_id
  15.                 AND D.ou_id=G.ou_id
  16.                 AND E.product_id=G.product_id
  17.                 AND A.sell_price_date > G.date_from
  18.                 AND A.sell_price_date < G.date_to
  19.                 AND F.code = G.price_level
  20.             INNER JOIN m_warranty_type H
  21.                 ON A.warranty_type_code=H.warranty_type_code AND H.tenant_id=B.tenant_id
  22.             WHERE A.ul_header_id=pUlHeaderId AND
  23.                 A.status=vStatusOk AND
  24.                 Z.tenant_id = B.tenant_id AND
  25.                 Z.sell_price_product_for_so_id = G.sell_price_product_for_so_id AND
  26.                 Z.warranty_type_id = H.warranty_type_id
  27.         );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement