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

  • SEARCH
  • Home
  • 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 9094289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:18:58+00:00 2026-06-16T23:18:58+00:00

I have 10 users in a DB. Each user can post as many links

  • 0

I have 10 users in a DB. Each user can post as many links as he wants. Each user can see all the links posted by the other users.

If one user clicks on a link, ex: google.com, he’ll not see it again, but those users who haven’t clicked that link, they can still click that link.

For this I have 2 tables (perhaps they are badly built, besides they are not related with foreign keys).

linksPosted

id   |   link   |   user
1        g.com      john
2        h.com      patrick
3        i.com      stephan
4        k.com      bart
....

clicksMade

id   |   link   |   user
1        g.com      jack
2        h.com      nick
...

So, there is a main page where every user can see the links posted by other users. Everytime a link is posted, this will be added to linksPosted table. OK.

Then, for example, Jack clicked g.com, so he’ll not be able to click g.com again. BUT, as Nick hasn’t clicked g.com, he’ll be able to click it.

How can I show some rows to some users and not to other not in a SQL query?

I’ve tried this without results I want:

Select * from linksPosted Except Select * from ClicksMade
SELECT * FROM linksPosted WHERE id NOT IN(SELECT id FROM ClicksMade);
SELECT t1.* FROM linksPosted AS t1 LEFT OUTER JOIN ClicksMade AS t2 ON t1.word = t2.word AND 1.user = t2.user WHERE t2.id IS NULL

Thanks.

  • 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-16T23:18:59+00:00Added an answer on June 16, 2026 at 11:18 pm

    Try this ::

    Select lp.link
    from 
    linkposted lp
    left join 
    (Select cm.id from clickMade where userId= ?
    ) as tempComment
    cm on (lp.id=tempComment.id)
    where cm.id is null 
    

    OR

        Select lp.link
        from 
        linkposted lp
    where id not in
        (
         Select cm.id from clickMade where userId= ?
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 10 users in a DB. Each user can post as many links
I have users, posts and comments. User can post only one comment to each
A user can have many posts, and each post can have many comments. When
I have 2 entities: User and Avatar . Each user can choice one avatar
I am creating a web application that will have many users. Each user has
Let's say that we have a users table, and a user can have many
I have some users that can have many posts , and each of those
I have set up a twitter-like following model. Users can all subscribe to each
I have an application where for each object the user can specify his own
I have make a messaging system in which user can send messages to each

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.