Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8589443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:03:34+00:00 2026-06-11T23:03:34+00:00

If I have three tables: posts —— postid date_posted title content views —— viewid

  • 0

If I have three tables:

posts
------
postid  date_posted title   content


views
------
viewid  post_id user_id


users
------
userid  username
  1. What is the correct way of listing all posts that have not been viewed by user_id? Is this query correct?

    SELECT * FROM posts LEFT JOIN views ON postid=post_id WHERE user_id=123 AND postid=NULL;

  2. How about listing all posts and their “view status” by user_id?

  3. Can you also recommend a great (user-friendly, non-geeky) resource to improve my understanding of LEFT JOIN, CROSS JOIN, and (normal joins? select * from posts, views)?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:03:36+00:00Added an answer on June 11, 2026 at 11:03 pm

    1.

    SELECT *
    FROM posts
    WHERE postid NOT IN (
        SELECT post_id 
        FROM views
        WHERE user_id = 123
    )
    

    OR

    SELECT *
    FROM posts
    LEFT JOIN views ON views.post_id = posts.postid AND views.user_id = 123
    WHERE viewid IS NOT NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Three tables, Posts, Tags, Posts_Tags_Link Posts has: id, content Tags has: id,
I have three tables. posts | id | title | +---------+-----------+ | 1 |
I have three tables: products (product_id, title) comments (comment_id, product_id, user_id, comment, post_date) bookmarks
I basically have three tables, posts, images and postimages (this simply contains the ids
I have three tables: Post, Attachment, and Media. Posts have Attachments, and Attachments have
Suppose I have the following three tables expressing a relationship where posts are given
I have two tables posts and comments . Table comments have post_id attribute. I
I have three tables: Posts Keywordings Keywords Relevant fields in parens. A Post has_many
I have three tables OWNERS: pk name POSTS: pk, post_date, owner_pk REPLIES: pk,reply_date, post_pk,owner_pk,comment_count
So, I'm going to say that I have three tables as follows: POSTS POSTS_TAGS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.