For a better definition please visit the below site
http://www.techterms.com/definition/recursivefunction
Table Structure:-
Create procedure [Ufms].[KC_SelectLedgersBank]
as
begin
WITH RecursiveLedgers AS (SELECT Ledger_ID, Ledger_Name, Parent_Ledger_ID
FROM Ledgers
WHERE (Ledger_ID = 3 )
UNION ALL
SELECT L.Ledger_ID, L.Ledger_Name, L.Parent_Ledger_ID
FROM RecursiveLedgers AS RL INNER JOIN
Ledgers AS L ON f.ledger_id = L.Parent_Ledger_ID )
SELECT Ledger_ID, Ledger_Name, Parent_Ledger_ID
FROM RecursiveLedgers
end
Out Put:-
It is very useful for MLM (Multi Level Marketing)
No comments:
Post a Comment