I am trying to find all the descendants or ancestors for a particular IC/SOC using loops in SQL. I basically need to crate an ancestor view or descendants view which lists all the versions before a given version.
Eg : SOC_test_1.1
SOC_test_1.1.1
SOC_test_1.1.1.1
SOC_test_1.1.1.2
SOC_test_1.1.2
SOC_test_1.2
SOC_test_1.2.1
SOC_test_1.2.2
Table :
Revision Name Rev Number
SOC_abc_001 1.1
SOC_abc_002 1.2
SOC_abc_003 1.1.1
SOC_abc_004 1.1.2
SOC_abc_005 1.3
SOC_abc_006 1.2.1
SOC_abc_007 1.1.1.1
SOC_abc_008 1.1.1.2
SOC_abc_009 1.4
SOC_abc_010 1.2.1
SOC_abc_011 1.5
I have a table which has revisions and revision numbers , they need not always co-relate to each other.
Case 1 : Given SOC_Test_1.1.1.1 I need the table to list all versions above it.
Case 2: Given SOC_Test_1.2 it should list SOC_test_1.1
Does this need Stored procedure? Any helpful pointers is appreciated.