SELECT
organization_id,
contact_id,
email_id,
session_id,
visitor_id,
event_name,
event_source,
tracking_source,
event_date,
event_type,
event_id,
`products.product_id`,
`products.variant_id`,
`products.quantity`,
`products.price`,
order_id,
order_date,
order_amount,
order_status,
order_coupons,
billing_address,
billing_city,
billing_country,
billing_country_code,
billing_region,
billing_phone,
billing_postcode,
billing_payment_method,
session_ip_address,
session_city,
session_region,
session_country,
session_country_code,
session_timezone,
session_latitude,
session_longitude,
session_user_agent_device,
session_user_agent_browser,
session_user_agent_version,
session_user_agent_platform,
session_source,
session_origin,
session_social,
session_medium,
session_referrer,
session_source_and_medium,
session_campaign,
Sign,
insertion_date
FROM events.order
WHERE Sign = 1 AND organization_id = 2997030
INTO OUTFILE 'josh.csv' FORMAT CSV