Home > Net >  SQL table LianZha more, only a one-to-one relationship between table and table, query how to write?
SQL table LianZha more, only a one-to-one relationship between table and table, query how to write?

Time:05-13

For example, A, B, C, D four tables, table 4 LianZha, then A, B, C, D table only A one-to-one corresponding relationship table, A table, only has something to do with B table, table only related to table C, B C table only has something to do with D table, this query should be how to write, I write my first released, you have A look at whether there is A problem,
 select a.Y IZHUID, a.Y IZHUFASONGID, b. UJIANID, c.f eiyong, d.m ingcheng 
The from z_yizhufasong a
Left the join z_lcfujian b
On a.Y IZHUFASONGID=b.Y IZHUFASONGID
Left the join z_feiyong c
On b. UJIANID=c.d uiyingid1
Left the join x_feiyongbiaozhun d
Surprised on SAN Antonio isuanjibianma=jeter isuanjibianma
Where yizhuid='

CodePudding user response:

Inner join

CodePudding user response:

This simply do not have what problem,
Table 4 cascade, it can be a parallel relationship, can also be a series,

Written form, can be written in the same layer, can also be in the form of stratification to write,

CodePudding user response:

I think you can write

CodePudding user response:

If there is a list that is in the redundancy in the relationship between, simply don't have to joint checked

CodePudding user response:

Of course there is something wrong with the
Where yizhuid ='
Yizhuid not name the host
  •  Tags:  
  • C#
  • Related