I have two tables: posts, and post_data, posts has an id, and post_data is linked to posts with the column post_id, here is the structure:
Posts
id
name
Post_Data
id
post_id
Value
Okay, so now I have some entries in the post table and some entries in the post_data table
The post_data table entries look like this:
id: 1
post_id:1001
value: test
id:2
post_id:1001
value: hello
id:3
post_id:1002
value: test
I need help writing a query that will ONLY return posts that have post_data of both “hello” and “test”. I know how to write the query to reutrn any post with post_data of “hello” OR “test” but I can’t seem to figure out how to write a query that only returns posts with BOTH “hello” and “test”
Thanks in advance 🙂