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

  • Home
  • SEARCH
  • 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 6707425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:38:13+00:00 2026-05-26T07:38:13+00:00

I’m coming across this situation alot, I’ll have a query that will have one

  • 0

I’m coming across this situation alot, I’ll have a query that will have one table needed in a join condition that may have no entries therefore requiring me to use a LEFT JOIN. I can’t wrap my head around the syntax when it’s used with more than 1 join.

I’ll have:

SELECT A.*, B.*, C.*
FROM A, B, C
WHERE A.id = C.id
AND C.aid = A.id
AND B.cid = C.id

Along comes D with the possibility of being empty and I have to rewrite the query and run into problems.

How can I simply join D to any one of these tables?

  • 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-26T07:38:13+00:00Added an answer on May 26, 2026 at 7:38 am

    My advice is to never specify more than one column on FROM clause.

    For clarity, it’s better to always:

    • Use JOIN clause
    • Use aliases
    • Specify columns of joined tables on left side of equal sign

    Example:

    SELECT a.*, b.*, c.*
    FROM ATable a
    INNER JOIN BTable b
      ON b.id = a.id
    INNER JOIN CTable c
      ON c.id = a.id
    WHERE a.someColumn = 'something'
    

    Not sure about MySQL, but in some other SQL flavors, you can use the same on UPDATES and DELETES, like:

    DELETE FROM a
    FROM ATable a
    INNER JOIN BTable b
      ON b.id = a.id
    INNER JOIN CTable c
      ON c.id = a.id
    WHERE a.someColumn = 'something'
    

    or

    UPDATE a
    SET  something = newValue
    FROM ATable a
    INNER JOIN BTable b
      ON b.id = a.id
    INNER JOIN CTable c
      ON c.id = a.id
    WHERE a.someColumn = 'something'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.