Hiding row from output

Hello

I have two tables

post
(post_id user_id post)

hide
(post_id user_id)

The post table contains all the posts submitted by the users.

The hide table contains all the posts that are to be hidden from the output.

How do I not display the posts that are in the hide table?

with a WHERE NOT EXISTS subquery

I’m already using a WHERE in my query. Can I use WHERE NOT EXISTS as well?

you would use WHERE something AND NOT EXISTS ( subquery )


SELECT
      p.post_id
     ,p.user_id
     ,p.post
  FROM
     post p
  LEFT OUTER
  JOIN
     hide h
    ON
     p.post_id = h.post_id
 WHERE
     h.post_id IS NULL