Last active
June 22, 2021 13:13
Star
You must be signed in to star a gist
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 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