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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:04:22+00:00 2026-06-09T05:04:22+00:00

i want to select a single record using from two tables. But if you

  • 0

i want to select a single record using from two tables. But if you use SIMPLE JOIN, it will only returns the value when the condition satisfies both the table and when we use LEFT or RIGHT JOIN also, it will return all the values from the LEFT or RIGHT table.

I’m using the following query,

SELECT *
FROM activity_feeds
LEFT OUTER JOIN activity_traders ON activity_feeds.feed_id = activity_traders.trdr_feed_id = '11'

I need to get the values from both tables only when activity_feeds.feed_id = activity_traders.trdr_feed_id = '11' and when the value does not matches with the right table, it should return null for the columns in the right table. Please help!

Edit:Table structures added

Feeds

enter image description here

Traders

enter image description here

  • 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-09T05:04:23+00:00Added an answer on June 9, 2026 at 5:04 am

    I assume that all the records are based from activity_feeds whether or not the feed_id exists on activity_traders table as long as it will display all feed_id that has a value of 11. Try this one.

    SELECT * 
    FROM   activity_feeds a
               LEFT OUTER JOIN  activity_traders b
                    ON a.feed_id = b.trdr_feed_id 
    WHERE  a.feed_id = '11'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a join between two tables and want to select the columns
I am using FMDB and I just want to select a single record using
I want to select information in a single cell from my DataGrid in Flex
I want to have on my site a single select box that will then
I want to copy a single record from a table, modify some of the
I want to simply retrieve a single record from a database in a classic
I want to display two records. For eg select * FROM users WHERE user_id
i have users table and i have posts table i want select from users
i have this lists, and i want select li element from jquery when the
I want to select distinct or unique records from a database I am querying.

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.