
Originally Posted by
juanc
... get the ID, post_title, post_excerpt, post_content from the wp_posts table and then the meta_value from the table wp_postmeta table but where the meta_key = "large_download_button" and the ID from wp_posts matches the post_id on wp_postmeta
let's see how closely the SQL solution matches this requirement statement
Code:
-- ID, post_title, post_excerpt, post_content from wp_posts
SELECT post.ID
, post.post_title
, post.post_excerpt
, post.post_content
-- meta_value from wp_postmeta
, meta.meta_value
FROM wp_posts AS post
INNER
JOIN wp_postmeta AS meta
-- the ID from wp_posts matches the post_id on wp_postmeta
ON meta.post_id = post.id
-- where the meta_key = "large_download_button"
AND meta.meta_key = 'large_download_button'
Bookmarks