Below is the table design
CustId Ver VersionNo Version ResNO Res Name Path
---------------------------------------------------------------------------
2 VF 2 V2 1 Low temp a/PV_7_temp.pdf
2 VF 2 V2 2 High temp a/temp/temp.pdf
If user enters path as 'a/PV_7_temp.pdf'
then result should be:
CustId Path
--------------------------
2 VF ---ver
2 V2 ---version
2 High ----Res
2 a/PV_7_temp.pdf -----path
If user enters path as 'a/temp/temp.pdf'
then result should be:
CustId Path
-------------------------
2 VF
2 V2
2 Low
2 a/temp/temp.pdf
Please help me get these desired results in SQL Server 2014