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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:43:04+00:00 2026-06-03T04:43:04+00:00

SELECT c1.address FROM users c1, users c2 WHERE c1.address = c2.address AND c2.first_name =

  • 0
SELECT c1.address
FROM users c1, users c2
WHERE c1.address = c2.address
AND c2.first_name =  'John'

I don’t understand what the third line is doing. I don’t understand it because this query returns two separate addresses even though in the condition it says address 1 must match address 2?

What am I missing?

Edit:

The table has three records of users. two of those users share the same first name ‘john’

Edit:

Also, why do we need to do this, instead of the following?

SELECT address
FROM users
WHERE first_name =  'John'
  • 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-03T04:43:05+00:00Added an answer on June 3, 2026 at 4:43 am

    Considering you’re only selecting the address, those selects are equivalent. It returns two addresses because there are two “Johns”.

    Joining on address would allow you to figure you who else lives with John. For example:

    SELECT c2.first_name
    FROM users c1, users c2
    WHERE c1.address = c2.address
    AND c1.first_name =  'John'
    AND c2.first_name != 'John'
    

    would tell you the names of everybody who lives with a “John”.

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

Sidebar

Related Questions

Suppose a query select streetAdr from Address returns 236 a1 road 333 a2 road
This SELECT finds Kelly as expected: select [First Name], [Last Name], Phone from [Data$]
I have a simple query select t.firstname, t.lastname, t.zipcode, t.city from name_data t where
Hello is it possible to select custom address after geocoding? Like in image below?
I'm using ABPeoplePickerNavigationController to let the user select an address. Everything works just fine
IList<Customer> Customers = flat.GroupBy(cust => new { cust.ReferenceNumber, cust.Name, cust.Address }) .Select(c => new
SELECT events.title FROM events ORDER BY events.title DESC I'm getting the proper ordering for
select @result=@input.query('*') for xml raw,type Above statement will generate following alert: Msg 6819, Level
SELECT sum(TotalHoursM) + (TotalHoursT) + (TotalHoursW) + (TotalHoursTH) + (TotalHoursF) AS TOTAL FROM LeaveRequest
SELECT (SELECT IIF(IsNull(sum(b.AmountCharged) - sum(b.AmountPaid)), a.Balance, (sum(b.AmountCharged) - sum(b.AmountPaid))) FROM tblCurrentTransaction AS b WHERE

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.