Query on the database to find email


I want to create a query with the data explorer plugin to find all the email addresses of the users. I tried to create a query on the “users” table but it’s not stored there.
I tried to find it on internet but couldn’t find a solution. I don’t even know if it’s possible.

Any idea ? Thanks

1 Like

Emails are stored in a separate database table. You can look them up in data explorer using something like:

SELECT users.id as user_id, user_emails.email 
FROM users 
LEFT JOIN user_emails 
ON users.id = user_emails.user_id 
AND user_emails.primary

Nice. That sorted it ! Many thanks