I have a working generated SQL query, however I can't work out how I can count it!
The GROUP BY function stops a normal COUNT(*) from working.. hope someone can help.
SELECT wposts.* FROM wp_posts wposts, wp_postmeta wpostmeta
WHERE wposts.ID = wpostmeta.post_id
AND wpostmeta.meta_key = 'phone'
AND wpostmeta.meta_value = '1542'
AND wposts.post_status = 'publish'
AND wposts.post_type = 'tips' || wposts.ID = wpostmeta.post_id
AND wpostmeta.meta_key = 'phone'
AND wpostmeta.meta_value = '1541'
AND wposts.post_status = 'publish'
AND wposts.post_type = 'tips' || ........
GROUP BY wposts.post_content
ORDER BY wposts.post_title ASC
Thanks