Clean up the expired/used up coupons [RESOLVED]

If your database has the JSON functions, which, I think, were introduced around MySQL 5.7, try the following:

SELECT * 
FROM `wp_gf_addon_feed` 
WHERE `addon_slug` = 'gravityformscoupons' 
AND JSON_UNQUOTE(JSON_EXTRACT(`meta`, '$.usageLimit')) = JSON_UNQUOTE(JSON_EXTRACT(`meta`, '$.usageCount'));
2 Likes