The original sqlite statement
With temp (cz_id, no1, no2)
As
(
Select * from node
Where no1 & gt; 0
The union
Select * from t. node t, temp
Where temp. No2=t.n o1 or temp. No1=t.n o2 or temp. No2=t.n o2 or temp. No1=t.n o1
) select * from temp
Hope to have a great god can help us into Oracle10g statement?
CodePudding user response:
10 g does not support this recursive query,
The building Lord baidu connect by, this can achieve your requirements,
CodePudding user response:
Connect by only the father s check child or a child of the father, with a direction, I don't have a parent-child relationship the no1 and no2, I not tried before
CodePudding user response:
11 g is a recursive query
Watch nice tutorial, connect that isn't a parent-child relationship, that is associated, so many people is to see a basic example is really think connect can only make the father-son relationship query,
Sqlite is not clear, but with oracle11g syntax to see you this statement dead cycle, test data and results are given, perhaps connect may also use the,
CodePudding user response:
The
reference 3 floor nayi_224 response: 11 g is a recursive query Watch nice tutorial, connect that isn't a parent-child relationship, that is associated, so many people is to see a basic example is really think connect can only make the father-son relationship query, Sqlite is not clear, but with oracle11g syntax to see you this statement dead cycle, test data and results are given, perhaps connect, may also use the Test data Cz no1 no2 1-665-565 1-674-756 1-565-234 1-567 1-665-778 1-674-777 1-665-866 1-666-665 1-909-674 The query results Cz no1 no2 1-674-756 1-567 1-674-777 1-909-674 CodePudding user response:
reference 4 floor qq_39269280 response: Quote: reference nayi_224 reply: 3/f 11 g is a recursive query Watch nice tutorial, connect that isn't a parent-child relationship, that is associated, so many people is to see a basic example is really think connect can only make the father-son relationship query, Sqlite is not clear, but with oracle11g syntax to see you this statement dead cycle, test data and results are given, perhaps connect, may also use the Test data Cz no1 no2 1-665-565 1-674-756 1-565-234 1-567 1-665-778 1-674-777 1-665-866 1-666-665 1-909-674 The query results Cz no1 no2 1-674-756 1-567 1-674-777 1-909-674 Explain the four results data are filtered by what rules CodePudding user response:
No first node positive and 234 connected data CodePudding user response:
The first node how come of, 234 you refers to article 3 of the data? You of the following four have to do with the 234 data, why other data was screen in addition to Rules are not clear, whether you in question? CodePudding user response:
Said the same node is linked together, the circle is the data query, the first node is positive, positive, positive, and all of the query is not connected to the first node node CodePudding user response:
select * from test0407 t0 the where t0 the rowid not in ( Select distinct rowid from test0407 t1 Start with (t1. No1 & gt; 0 or t1. No2 & gt; 0) Connect by nocycle (the prior t1. No1=t1. No1 or the prior t1. The no1.=t1 no2 or the prior t1, no2=t1. The no1 or the prior t1, no2=t1. No2) ) ; CodePudding user response:
This I am particularly slow when hundreds of lines of a query, the data quantity is little ok, can you optimize the references 9 f nayi_224 response: select * from test0407 t0 the where t0. The rowid not in ( Select distinct rowid from test0407 t1 Start with (t1. No1 & gt; 0 or t1. No2 & gt; 0) Connect by nocycle (the prior t1. No1=t1. No1 or the prior t1. The no1.=t1 no2 or the prior t1, no2=t1. The no1 or the prior t1, no2=t1. No2) ) ; CodePudding user response:
references to the tenth floor qq_39269280 response: this as soon as I query about when the hundreds of special slow, less amount of data is good, can you optimize the Quote: references 9 floor nayi_224 response: select * from test0407 t0 the where t0 the rowid not in ( Select distinct rowid from test0407 t1 Start with (t1. No1 & gt; 0 or t1. No2 & gt; 0) Connect by nocycle (the prior t1. No1=t1. No1 or the prior t1. The no1.=t1 no2 or the prior t1, no2=t1. The no1 or the prior t1, no2=t1. No2) ) ; Hierarchical search queries only violence, data much more slowly, of course, want to quickly can achieve in the stored procedure recursively inserted to the temporary list, or to organize all the data, marked in advance which is associated with, May use the mod also can implement, have the time I'll check again CodePudding user response:
Here do not have permission to build storage The mod's modulo, how to use, is not very understanding CodePudding user response:
The refer to 12 floor qq_39269280 reply: here do not have permission to build storage Mod modulo, how to use, is not very understanding Don't say, is the grammar, CodePudding user response:
, has not been used for knowledge, learning how to learn