Skip to content
Prodjex

WordPress SQL Syntax Example

1 min read

WordPress SQL Syntax Example

I have a couple of tables I'm joining and only want to return users that a field missing in the joined table.

Users id
fname
lname

userMeta id
metaKey
metaValue

I'm trying to find users that don't have a record in the userMeta table of metaKey = userpro_verified

select * 
from Users 
where id not in (select id from userMeta where m.metaKey = "userpro_verified")
  • meta Key
  • metaValue
  • mysql
  • plugin
  • sql
  • userpro_verified

Keep reading