Home > database >  Data hierarchy statistical problems, everyone a great god ~ ~ ~ ~
Data hierarchy statistical problems, everyone a great god ~ ~ ~ ~

Time:09-25

Everyone a great god help me ~ ~ ~ ~ ~ ~ please help o a head two big, now can't write out the results!!!!!


Table1
ID CODE NAME ITEM_CODE PRICE PARENT_ID
1001 C101 the country's 9001 11 0
1001 C101 the country's 9002 12 0
1001 C101 the country's 9003 13 0


Table2
ID CODE NAME ITEM_CODE PRICE PARENT_ID
2001 south C201 9002 21 1001
2001 south C201 9003 22 1001
2002 C202 north 9001 27 1001
2002 north C202 9002 28 1001
2002 C202 north 9003 29 1001


Table3
ID CODE NAME ITEM_CODE PRICE PARENT_ID
3001 C301 south China 9001 31 2001
3001 C301 south China 9002 32 2001
3001 C301 south China 9003 33 2001
3002 C302 north China 9002 38 2002
3002 C302 north China 9003 39 2002


Table3
ID CODE NAME ITEM_CODE PRICE PARENT_ID
4001 C401 south China customer 1 9001 41 3001
4001 C401 south China customer 1 9002 42 3001
4002 C402 north China customer 1, 9001, 47, 3002
4002 C402 north China customer 1 9002 48 3002
4002 C402 north China customer 1 9003 49 3002


The ID in table2 the PARENT_ID in table1;
Table3 the PARENT_ID in table3 the ID;
In table4 PARENT_ID in table3 ID;
In table2, table3, table4 ITEM_CODE exists in the table,

Four tables associated results for needs the results of the channel ()
ITEM_CODE table1. Code table1. The name table1. Price table2. Code table2. Name table2. Price table3. Code table3. Name table3. Price table4. Code table4. Name table4. Price
9001 C101 national 11 0 C301 C201 south south China 31 C401 south China customer 1 41
9002 C101 national 12 C201 south 21 32 C401 C301 south China south China customer 1 42
9003 C101 national 13 22 C301 C201 south south China 33 0
9001 C101 11 C202 27 0 C402 north north China customer 1 47
9002 C101 national 12 28 C302 C202 northern north China 38 C402 north China customer 1 48
9003 C101 national 13 39 C402 29 C302 C202 northern north China north China customer 1 49

CodePudding user response:

Preempt a sofa, check yourself in a minute

CodePudding user response:

Table3 the PARENT_ID in table3 the ID;
There are two 3 4 questions seriously no ah brothers

CodePudding user response:

This,,, if the simple use start with die cycle
  • Related