Home > database >  Small white, consult your bosses to give directions, thank you
Small white, consult your bosses to give directions, thank you

Time:10-08

if there are four tables, including A, B and C, and D table associated with A table
B.q A.q op=C.q op, op=C.q op, A.t a=which a
How should I put the ABCD four LianZha?
Or how the results of ABC three table LianZha associated with D again query?

Bosses once again thank you for your advice, but also looks at detail, thank you

CodePudding user response:

No bosses will grant instruction

CodePudding user response:

If you use SQL statements,
If you want to find out the value of A row in table A,

Select the columns you need from table A and table B, C, D table where (table A.q op=table B.q op) and (table A.q op=table C.q op) and (table A.t table which A=A) and (other conditions);

CodePudding user response:

Look at what you said should use data window to set up a filter or automatic filtering can query condition

CodePudding user response:

Select * from (select * from A, B, C where A.q op=C.q op, B.q op=C.q op) aa, d where aa. Ta=which A

CodePudding user response:

No direct relationship between A and B, A and C, B and C, A and D have relationship, so I can write A statement
The select a.t. A, a.q op, b.q op, c.q op, which a
From a
The join b on a.q op=b.q op
The join c on b.q op=c.q op
The join d on a.t a=which a

Execute the statement above, under the results look at, whether the result you want,

CodePudding user response:

Fixed: no direct relationship between A and B, A and C, B and C, A and D have relationship, so I can write A statement
The select a.t. A, a.q op, b.q op, c.q op, which a
From a
The join c on a.q op=c.q op
The join b on b.q op=c.q op
The join d on a.t a=which a

Execute the statement above, under the results look at, whether the result you want,

CodePudding user response:

The
Quote: refer to the original poster juventus713 response:

[size=16 px] if there were four tables, among them A, B are associated with C, and D table associated with A table
B.q A.q op=C.q op, op=C.q op, A.t a=which a
How should I put the ABCD four LianZha?
Or how the results of ABC three table LianZha associated with D again query?

Assume that C table data as the main data, different join the original poster can also be used to achieve the result that want to query

Select *
The from C
Left the join A on A.q op=C.q op
Left on the join B B.q op=C.q op
Left on the join D A.q op=C.q op
  • Related