SELECT
        pr.id,
        pr.hospital_id as warehouse_id,
        hp.dealer_id as customer_id,
        1 as supplier_id,
        ps.product_category_id,
        pr.product_set_id,
        -2147483648 as product_id,
        pr.price,
        pr.kick_back,
        pr.price_note as note,
        NOW() as created_at,
        NOW() as updated_at
FROM prices as pr
LEFT JOIN hp_dl_relations as hp
     ON pr.hospital_id = hp.hospital_id
LEFT JOIN product_sets as ps
     ON pr.product_set_id = ps.id
INTO OUTFILE "/tmp/wholesale_prices.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';