3 added 26 characters in body
source | link

Try this one with additional join on metadata

SELECT u.ID, u.display_name
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
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA'
GROUP BY u.ID

Also use group by

Try this one with additional join on metadata

SELECT u.ID, u.display_name
FROM wp_users u 
LEFT JOIN um1 ON u.ID = um1.user_id
LEFT JOIN um2 ON u.ID = um2.user_id
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA'
GROUP BY u.ID

Also use group by

Try this one with additional join on metadata

SELECT u.ID, u.display_name
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
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA'
GROUP BY u.ID

Also use group by

2 added 27 characters in body
source | link

Try this one with additional join on metadata

SELECT wp_usersu.ID, wp_usersu.display_name
FROM wp_users u 
LEFT JOIN um1 ON u.ID = um1.user_id
LEFT JOIN um2 ON u.ID = um2.user_id
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA'
GROUP BY u.ID

Also use group by

Try this one with additional join on metadata

SELECT wp_users.ID, wp_users.display_name
FROM wp_users u 
LEFT JOIN um1 ON u.ID = um1.user_id
LEFT JOIN um2 ON u.ID = um2.user_id
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA' 

Try this one with additional join on metadata

SELECT u.ID, u.display_name
FROM wp_users u 
LEFT JOIN um1 ON u.ID = um1.user_id
LEFT JOIN um2 ON u.ID = um2.user_id
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA'
GROUP BY u.ID

Also use group by

1
source | link

Try this one with additional join on metadata

SELECT wp_users.ID, wp_users.display_name
FROM wp_users u 
LEFT JOIN um1 ON u.ID = um1.user_id
LEFT JOIN um2 ON u.ID = um2.user_id
WHERE um1.meta_value= 'value1' AND um1.meta_key = 'key1'
AND um2.meta_key = 'keyA' AND um2.meta_value = 'valueA'