Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select c.id as id,
- coalesce(c.brand, p.brand) as brand,
- coalesce(c.name, p.name) as name,
- p.api_url,
- c.code as code,
- coalesce(c.price, p.price * (100 - c.discount) / 100) as price,
- p.type as type,
- p.subtype as subtype,
- coalesce(c.period, p.period) as period,
- c.ttl as ttl,
- p.schema as schema
- from product p
- join campaign c on (c.product=p.id)
- where c.not_before <= now()
- and c.not_after > now();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement