FAQ Database Discussion Community


Calculating Formula with CTE tree

sql,sql-server-2008,sql-cte
Data I have following partial data id parent multiplier const -- ------ ---------- ----- 1 NULL 1.10 1.00 2 1 1.20 2.00 3 1 1.30 3.00 4 1 2.40 4.00 5 2 2.50 5.00 6 2 2.60 6.00 7 2 2.70 17.00 8 3 2.80 18.00 9 3 3.90 19.00...

Get Parent and grand parents of a particular child

sql-server,sql-server-2005,sql-cte
i have table like below tablename :ExampleTable ChildID ChildCommonID ParentID 1 2 0 2 3 0 3 4 1 4 5 3 5 6 4 The Problem is : i have a child id example :ChildID= 5 so i need to check wheather it has a parent or not if...