I am trying to retrieve post_id, post_year, post_desc, post_title, post_date from one table and img_filename from another table where the post_id is equal and where is_thumb is 1 (where i have chosen that image as the posts thumbnail)
This is as far as I have got without luck:
SELECT post_id, post_year, post_desc, post_title, post_date,
FROM mjbox_posts
JOIN mjbox_images
USING (img_is_thumb)
WHERE img_is_thumb = 1
AND mjbox_images.post_id = mjbox_posts.post_id
Thanks
or, if you prefer
USINGsyntax,The difference is that the first query returns
post_idfrom both tables and you need to alias it.