Re: RECURSIVE allowed only ONCE in a CTE

2019-02-22 Thread Jitendra Loyal
Thanks Got it Regards, Jitendra On Fri 22 Feb, 2019, 4:03 PM mariusz On Fri, 22 Feb 2019 13:23:11 +0530 > Jitendra Loyal wrote: > > > I find that the RECURSIVE can be used only once in a CTE. > > > > I have the following use-case where there is a hierarchy of > > store_groups, and then

Re: RECURSIVE allowed only ONCE in a CTE

2019-02-22 Thread Jitendra Loyal
Thanks Andrew I will try this and revert; I was specifying RECURSIVE for the second CTE as well. Regards, Jitendra

Re: RECURSIVE allowed only ONCE in a CTE

2019-02-22 Thread mariusz
On Fri, 22 Feb 2019 13:23:11 +0530 Jitendra Loyal wrote: > I find that the RECURSIVE can be used only once in a CTE. > > I have the following use-case where there is a hierarchy of > store_groups, and then there are stores associated with a > store_group. Requirement is to ensure that a store

Re: RECURSIVE allowed only ONCE in a CTE

2019-02-22 Thread Andrew Gierth
> "Jitendra" == Jitendra Loyal writes: Jitendra> I find that the RECURSIVE can be used only once in a CTE. RECURSIVE can be specified only once, but it applies to all CTEs at that level. That is to say, RECURSIVE qualifies the preceding WITH, _not_ the following CTE. Note that just

RECURSIVE allowed only ONCE in a CTE

2019-02-22 Thread Jitendra Loyal
I find that the RECURSIVE can be used only once in a CTE. I have the following use-case where there is a hierarchy of store_groups, and then there are stores associated with a store_group. Requirement is to ensure that a store can be used only once in a store group hierarchy. Following