Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-06 Thread Jing Fan
Yeah, that can explain why it doesn't work. Thank you very much:) On Wed, Nov 6, 2013 at 8:40 AM, Albe Laurenz wrote: > Jing Fan wrote: > > On Wed, Nov 6, 2013 at 8:10 AM, Albe Laurenz > wrote: > >> Let's assume that we have three nodes A, B and C. > >>

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-06 Thread Jing Fan
AM, Albe Laurenz wrote: > Jing Fan wrote: > > I am sorry but I still don't understand why it doesn't work. Possibly I > misunderstand how with > > recursive works? > > In my opinion, > > with recursive table as{ > > seed statement > >

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-06 Thread Jing Fan
6, 2013 at 2:13 AM, Albe Laurenz wrote: > Jing Fan wrote: > > If the grouping inside CTE is executed, I don't think it would generate > result like > > > > src_id | dest_id | dist > > +-+-- > >3384 |6236 |1 > >3384

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Jing Fan
y min(). It actually generate no new tuples and the iteration should stop. Best, Jing On Tue, Nov 5, 2013 at 9:28 AM, Albe Laurenz wrote: > Jing Fan wrote: > > Why the one inside does not do anything? It won't be executed? > > It is executed. > > It might filter out the

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Jing Fan
Why the one inside does not do anything? It won't be executed? Best, Jing On Tue, Nov 5, 2013 at 8:52 AM, Albe Laurenz wrote: > Jing Fan wrote: > > I have two group operations. > > > > One is inside the CTE ( union > >

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Jing Fan
, Jing On Tue, Nov 5, 2013 at 5:04 AM, Albe Laurenz wrote: > Jing Fan wrote: > > I use following command to get a shortest-path query: > > > > with recursive paths( src_id, dest_id, dist) as( > > select n1,n2,1 > > from nodes > > u

[GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-04 Thread Jing Fan
I use following command to get a shortest-path query: with recursive paths( src_id, dest_id, dist) as( select n1,n2,1 from nodes union select src_id, dest_id, min(dist) from ( select paths.src_id as src_id, nodes.n2 as dest_id, paths.dist+1 as dist