Home > database >  On the right the join operation sequence
On the right the join operation sequence

Time:10-22

HTML code is as follows, a and b have common known data, no common data a and c, b and c have a common data, why to add the last b.q j=a.q j conditions, c field value is empty?

CodePudding user response:

Ask the company a great god, and know that run order from the top down, first run a and c connection part, results are as follows:
The result set in the next period of SQL right connection with b, at this time of the a.q a.q j=b.q j j data range is not the whole a table, but the above result sets, a.q j and b.q j no matching content, so only shows the right connection b data, concentration does not meet the above results of the data line, so the c field is empty,

CodePudding user response:

First of all, there are two RIGHT JOIN, and there is no WHERE clause, so will the B table data, display all,
AND B table conditions, after the B.Q J=C.Q AND B.Q=A.Q J J J, can reason out A.Q J=C.Q J, but A.Q J=C.Q J doesn't exist,
So A and C table data, all is empty,
  • Related