i would like to export all users with user_metas.
Right now my sql looks like that
SELECT
u.ID,
u.user_email,
u.display_name,
um1.meta_value AS first_name,
um2.meta_value AS last_name,
um3.meta_value AS phone_number,
um4.meta_value AS salutation,um5.meta_value AS title
FROM wp_users u
LEFT JOIN wp_usermeta um1 ON u.ID = um1.user_id
LEFT JOIN wp_usermeta um2 ON u.ID = um2.user_id
LEFT JOIN wp_usermeta um3 ON u.ID = um3.user_id
LEFT JOIN wp_usermeta um4 ON u.ID = um4.user_id
LEFT JOIN wp_usermeta um5 ON u.ID = um5.user_id
WHERE um1.meta_key = 'first_name'
AND um2.meta_key = 'last_name'
AND um3.meta_key = 'phone_number'
AND um4.meta_key = 'salutation'
AND um5.meta_key = 'title'
The problem is I would like to get all user and not only those with the meta_keys specified above.
How would I do that?
WHERE
clause?