Created
January 28, 2018 02:11
-
-
Save CatEntangler/347557f51ae49532ca9546cc669e77c6 to your computer and use it in GitHub Desktop.
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 main.lead_id | |
FROM wp_rg_lead_detail as main | |
WHERE main.form_id = 1 | |
AND main.lead_id NOT IN ( | |
SELECT wp_rg_lead_detail.lead_id | |
FROM wp_rg_lead_detail | |
WHERE wp_rg_lead_detail.form_id = 1 | |
AND wp_rg_lead_detail.field_number = 102 | |
AND wp_rg_lead_detail.value <> '' | |
) | |
GROUP BY main.lead_id | |
ORDER BY main.lead_id ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needed to get a list of leads from gravity forms tables that either didn't have a value or didn't have a row with the field_number 102
Using GFAPI::get_entries isn't documented at all and trial and error was taking too long.
This worked.
replace form_id and field_number with whatever.