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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:55:58+00:00 2026-05-23T12:55:58+00:00

What I am trying to do is list an entry each time they have

  • 0

What I am trying to do is list an entry each time they have referred someone and that person is listed in the entries table as well. 3 different queries I have tried are:

SELECT a.ID,b.Email FROM Entries a 
INNER JOIN ReferAFriend b ON b.EntryID = a.ID 
INNER JOIN (SELECT DISTINCT Email FROM Entries c ON b.Email = c.Email)
WHERE a.ID = 47667

SELECT a.ID,b.Email FROM Entries a 
INNER JOIN ReferAFriend b ON b.EntryID = a.ID AND b.Email IN (SELECT DISTINCT Email FROM Entries) 
WHERE a.ID = 47667

SELECT a.ID,b.Email FROM Entries a 
INNER JOIN ReferAFriend b ON b.EntryID = a.ID 
WHERE b.Email IN (SELECT DISTINCT Email FROM Entries) AND a.ID = 47667

The result of all 3 is just 1 entry.

If I do:

SELECT a.ID,b.Email FROM Entries a 
INNER JOIN ReferAFriend b ON b.EntryID = a.ID 
WHERE a.ID = 47667

I get a list of 20 entries because there are 20 referred friends, however there are only 4 that are in the entries database, which is what the other query is supposed to filter from these 20, but it only returns 1 result.

Can anyone point me in the right direction here?

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-05-23T12:55:59+00:00Added an answer on May 23, 2026 at 12:55 pm

    The WHERE clause is filtering out the results to just one. Changed that and it works.

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

Sidebar

Related Questions

What I have Currently I have a view that creates a list of entries,
I am trying to list last a website's statistics. I listed Last 30 days
I am trying to list all of the columns from whichever Adventureworks table I
I'm trying to access list data using SSRS 2008. I have created an XML
Trying to do it through a loop that traverses through the list. In the
I'm trying to build an array in javascript that contains a list of ids.
Doing some R&D for my company. We are trying to have a listView that
I'm trying to list a series of entries by the first letter of the
I am trying to created a csv file where each entry is inputed by
I'm trying to the get the class of each item in an unordered list,

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.