Viewing 8 posts - 1 through 9 (of 9 total)
Resolved 🙂
It should be
OVER (ORDER BY ParentID, OC)
not
OVER (ORDER BY OC, ParentID)
Thx again!
May 16, 2010 at 5:35 am
There is a problem... I modified data as follows:
DECLARE @FirstTable TABLE
( ParentID int , ParentName char(4) )
insert @FirstTable
...
May 16, 2010 at 5:15 am
Perfect!!!!
Thank you so much!
P.S.
I'm sorry, you are absolutely right about example data. Next time i'll use create table and insert!
May 16, 2010 at 4:27 am
Thank you so much Peter and Paul. I tested Peter solution and it works perfectly.
I wanted to know if hierarchyid works in SQL 2005, because i get "Type hierarchyid is...
March 20, 2010 at 3:59 pm
Hello Peter!
Thx for you response.
I think you misunderstood the problem. There is no group by "name", because all the records are unique. It means "name" can not be repeated twice,...
March 20, 2010 at 6:29 am
Unfortunately it takes a lot of time, because db is more than 200GB, and DB is in live production, so i can't allow to do it...
During new year days...
January 3, 2010 at 10:40 am
Thank you so much Mark! Very elegant solution... I was also thinking for double join, but was falling in the same trap as Roger, thinking that it will not work,...
September 27, 2009 at 9:43 am
Viewing 8 posts - 1 through 9 (of 9 total)