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 3238226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:49:46+00:00 2026-05-17T17:49:46+00:00

Hey guys, I am really messing up with this. I tried this but it

  • 0

Hey guys, I am really messing up with this. I tried this but it failed. I have following three tables with user polard searched 2 times at different days, with increased friends in second search in table b. I just need to build the query which will give me the two newly added friends (wont be present in end of list of second search). In table c there will be 20 friends of polard displayed with usid 1 and then 22 friends with usid 2 means total records will be 42.

table a               
uid  name
1     karos
2     polard

table b                              
usid  umid name    friends
1      2  polard    20
2      2  polard    22

table c 
usrid   usid  name   friends
 1       1    hansy  10
 2       1    boje   23
 .       .     .      .
 .       .     .      .   

Your help will be geatly appreciated.
Thank you in advance.

  • 1 1 Answer
  • 1 View
  • 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-05-17T17:49:46+00:00Added an answer on May 17, 2026 at 5:49 pm

    Is this what you are looking for?

    SELECT usrid 
    FROM c 
    WHERE usid = 2 
    AND usrid NOT IN (SELECT usrid FROM c WHERE usid = 1) 
    

    If you want both the usid values to be dynamic as well, assuming that you need to do for the latest usid for polard, it might be something like

    SELECT usrid 
    FROM c 
    WHERE usid = 
           SELECT MAX (usid) FROM b WHERE name = 'polard') 
    AND usid NOT IN 
          (SELECT usrid FROM c WHERE usid = 
               SELECT MAX (usid) - 1 FROM b WHERE name = 'polard')) 
    

    This is assuming that the usid values are integer incrementing values specific for each umid in table b.

    If they arent, then it will be a bit more complicated as you need to do an Order by and get the 2nd to last umid value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
hey guys, this might be really stupid, but hopefully someone can help. I'm trying
hey guys, i spent some time on this one but i find it really
Hey guys, This could be a noob question, but I really can't find any
Hey guys really quick question, I have a simple test that I was doing
Hey guys, I have another really annoying problem in IE. I am using a
Hey guys, this is my first time actually posting at stackflow but i've used
Hey guys, I'm reviewing some questions but I can't really figure it out, i
Hey guys i could really use some help coding this IF statement! I managed
Hey Guys I Am really new to making apps and this a error that

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.