Advertisement
zotov-vs

dwh_pickpoint_postamats

Jun 20th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.57 KB | None | 0 0
  1. CREATE OR REPLACE ALGORITHM = MERGE VIEW dwh_pickpoint_postamats AS
  2.  
  3. SELECT pp.Number AS pickpoint_postamats_id
  4. , pp.Address AS address
  5. , pp.Name AS name
  6. , IFNULL(dp.is_active,0) AS is_active
  7. , IFNULL(dp.fias_id,0) AS fias_id
  8. , IFNULL(dp.price, 0) AS price
  9. FROM pickpoint_postamats AS pp
  10. LEFT JOIN delivery_pickpoint AS dp ON dp.pickpoint_city_id = pp.CitiId
  11. JOIN dwh_upload_config AS duc ON duc.component = 'dwh_pickpoint_postamats'
  12. WHERE
  13.          (duc.date_from_use = 0 OR pp.date_update >= duc.date_from)
  14.          AND (duc.date_to_use = 0 OR pp.date_update <= duc.date_to)
  15. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement