Reputation: 3674
Some submitters have submitted location strings that are too short. How can I query them to remove them in phpMyAdmin?
The query would look like this (ending is obviously pseudo code):
SELECT `post_id` FROM `wp_postmeta`
WHERE `meta_key` = 'location'
AND `meta_value` HAS LESS THAN 10 CHARACTERS
Upvotes: 2
Views: 1728
Reputation: 2872
SELECT `post_id` FROM `wp_postmeta` WHERE `meta_key` = 'location' AND CHAR_LENGTH(meta_value) < 10
Upvotes: 4