Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- MIN(id) AS vMIN,
- MAX(id) AS vMAX
- FROM (
- SELECT
- id
- , COUNT(id) over (ORDER BY id) DIV 500000 AS rn
- FROM (
- SELECT products_attributes_id AS id
- FROM dwh_shipment_products_from_categories
- WHERE last_date_update_p >= '2019-06-01'
- UNION
- SELECT products_attributes_id AS id
- FROM dwh_shipment_products_from_categories
- WHERE last_date_update_pp >= '2019-06-01'
- UNION
- SELECT products_attributes_id AS id
- FROM dwh_shipment_products_from_categories
- WHERE last_date_update_c >= '2019-06-01'
- ) AS t
- ) AS t2
- GROUP BY rn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement