i have a table like so:
email | segment | exit --------------------------------------------- [email protected] | abandoned_cart | true [email protected] | purchased_last_7_days | false [email protected] | abandoned_cart | true [email protected] | purchased_last_7_days | false [email protected] | abandoned_cart | true I am trying write a query to get a count of unique email addresses that have BOTH abandoned_cart = true and purchase_last_7_days = false
This is what I tried but recieved 0:
SELECT COUNT(DISTINCT email) FROM `table_seg_changes` WHERE (segment_slug = 'purchased_last_7_days' AND exit = false) AND (segment_slug = 'abandoned_cart' AND exit = true)