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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:06:13+00:00 2026-06-13T02:06:13+00:00

my first result looks like this ID Name ———————————- 1 George 2 Peter 3

  • 0

my first result looks like this

ID       Name
----------------------------------
1        George
2        Peter
3        San

my other result looks like this

AnotherID     ID     Note
-----------------------------------
1             1      georgesnote1
2             1      georgesnote2
3             3      sansnote1
4             1      georgesnote3

How I want them to look:

ID       Name        Note
----------------------------------
1        George      georgesnote1
1        George      georgesnote2
1        George      georgesnote3
2        Peter       NULL
3        San         sansnote1

My SQL knowledge pretty much limits me to achieve this. I guess I need something like UNION ALL. INNER JOIN OR LEFT OUTER JOIN doesnt work. My actual query is around 21 lines so this is not a beginner question. What I need is to join two results based on same IDs. Please someone guide me.

  • 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-13T02:06:14+00:00Added an answer on June 13, 2026 at 2:06 am

    You need a LEFT JOIN.

    check out http://www.w3schools.com/sql/sql_join_left.asp

    Assugming the first table is called first and the second is called second.
    The column id on the first table will be matched to the column id on the second table.

    SELECT first.id, first.name, second.note
    FROM first
    LEFT JOIN second
    ON first.id = second.id
    ORDER BY first.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a multi-dimensional array looks like this. $config = array( First Name
my data looks like this in the table: ID Name Parent ID --- ----
I have an array that looks like this: [867324] [id] => 867324 [name] =>
First Table is the View and Second is the result I want This below
First, the desired result I have User and Item models. I'd like to build
I am actually stuck in merging the result of this two queries: first query:
I build a family tree. The table looks like this: id------firstname------mother------father-------kids this is the
I have a table array which looks like this: tablearray = [ {'column1': 1,
I am trying to look a file that looks who's path looks like this.
My JSON string looks like this (contained in a string variable called sJSON ):

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.