Home > database >  LEFT the JOIN return value problem ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
LEFT the JOIN return value problem ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Time:09-15

Two queries, the first is the INNER JOIN, the second is a LEFT JOIN, why don't the result returned the same???????

CodePudding user response:

Originally should not the same, the same don't have a problem,
Within the INNER JOIN for connection, only to return two table that matches the data
LEFT the JOIN to do connection, all eligible data back to the table on the LEFT back on the right side of the table data matching two tables, does not match the data returns null

CodePudding user response:

reference 1st floor js14982 response:
was always supposed to different ah, don't have a problem,
Within the INNER JOIN for connection, only to return two table that matches the data
LEFT the JOIN to do connection, all eligible data back to the table on the LEFT back on the right side of the table data matching two tables, does not match the data return null


Yes, thank you for your answer, but the conditions of the two queries where filtering is the same, left the join query the corresponding right table BOARD_ID should have two records returns NULL, but are now return a value

CodePudding user response:

refer to the second floor lv5956047123 response:
Quote: refer to 1st floor js14982 response:
was always supposed to different ah, don't have a problem,
Within the INNER JOIN for connection, only to return two table that matches the data
LEFT the JOIN to do connection, all eligible data back to the table on the LEFT back on the right side of the table data matching two tables, does not match the data return null


Yes, thank you for your answer, but the conditions of the two queries where filtering is the same, left the join query the corresponding right table BOARD_ID should have two records returns NULL, but are now returns a value

Oh, see, I see the bifurcation is above,
This kind of situation you try to try space, or data changes are there?

CodePudding user response:

A.A CT_id=trim (B.B OARD_ID)

CodePudding user response:

Connect the value of the field in the two tables are not completely consistent, the space such as a new line
  • Related