jellytoe Member Sep 13, 2015 #1 I am wanting to query the database where location = "specific city" and return a list of e-mails. Can anyone help with how to write the query? I'm a clueless SQL user.
I am wanting to query the database where location = "specific city" and return a list of e-mails. Can anyone help with how to write the query? I'm a clueless SQL user.
P Paul B XenForo moderator Staff member Sep 13, 2015 #2 Try this: Code: SELECT u.email FROM xf_user as u LEFT JOIN xf_user_profile AS p ON (p.user_id = u.user_id) WHERE p.location = 'London' Change 'London' to suit.
Try this: Code: SELECT u.email FROM xf_user as u LEFT JOIN xf_user_profile AS p ON (p.user_id = u.user_id) WHERE p.location = 'London' Change 'London' to suit.