Last active
June 22, 2021 13:13
-
-
Save macmladen/04d8c6cb26a4d2d4008f3b3963c65d06 to your computer and use it in GitHub Desktop.
WordPress select users and extended profile data which is stored in same column. Lookup hint https://dba.stackexchange.com/questions/9011/proper-use-of-lookup-tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ID, user_email email, user_registered registered, user_status status, | |
(SELECT meta_value FROM `pltfrm_usermeta` WHERE meta_key='last_activity' AND user_id=u.ID ) as active, | |
(SELECT meta_value FROM `pltfrm_usermeta` WHERE meta_key='first_name' AND user_id=u.ID ) as Name, | |
(SELECT meta_value FROM `pltfrm_usermeta` WHERE meta_key='last_name' AND user_id=u.ID ) as Surname | |
FROM `pltfrm_users` u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment