A table
The create table a
(aid varchar2 (40),
Name varchar2 (100),
Parentid varchar2 (40)
);
Table b
The create table b
(aid varchar2 (40),
Operation varchar2 (100)
);
A table data below
AID the name parentid
420000000000 in hubei province 000000000000
Huangshi city, hubei province 420200000000 420000000000
420202000000 huangshi Yellowstone harbor 420200000000
420203000000 cisse huangshi city mountain 420200000000
B table data below
AID operation
420000000000, 12312321321,
Hope to get the results
AID operation
420000000000, 12312321321,
420200000000, 12312321321,
420202000000, 12312321321,
420203000000, 12312321321,
Great god action, in order to reduce the pressure in table b store only the parent ID, but want to get results all subsets of the parent ID, like a statement with
CodePudding user response:
- the building Lord baidu this string,Oracle connect by the prior id=id
CodePudding user response:
To describe, lest any misunderstandingThere are two list
A table
The create table a
(aid varchar2 (40),
Name varchar2 (100),
Parentid varchar2 (40)
);
Table b
The create table b
(aid varchar2 (40),
Operation varchar2 (100)
);
A table data below
AID the name parentid
420000000000 in hubei province 000000000000
Huangshi city, hubei province 420200000000 420000000000
420202000000 huangshi Yellowstone harbor 420200000000
420203000000 cisse huangshi city mountain 420200000000
B table data below
AID operation
420000000000, 12312321321,
420200000000, 36565112121,
Hope to get the results
AID operation
420000000000, 12312321321,
420200000000, 12312321321,
420202000000, 12312321321,
420203000000, 12312321321,
420200000000, 36565112121,
420202000000, 36565112121,
420203000000, 36565112121,
Great god action, in order to reduce the pressure in table b store only the parent ID, but want to get results all subsets of the parent ID, like a statement
CodePudding user response: