Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE ALGORITHM = MERGE VIEW dwh_pickpoint_postamats AS
- SELECT pp.Number AS pickpoint_postamats_id
- , pp.Address AS address
- , pp.Name AS name
- , IFNULL(dp.is_active,0) AS is_active
- , IFNULL(dp.fias_id,0) AS fias_id
- , IFNULL(dp.price, 0) AS price
- FROM pickpoint_postamats AS pp
- LEFT JOIN delivery_pickpoint AS dp ON dp.pickpoint_city_id = pp.CitiId
- JOIN dwh_upload_config AS duc ON duc.component = 'dwh_pickpoint_postamats'
- WHERE
- (duc.date_from_use = 0 OR pp.date_update >= duc.date_from)
- AND (duc.date_to_use = 0 OR pp.date_update <= duc.date_to)
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement