pacificpear
Programmer
Sql server
I have two tables X and Z
TABLE X
HOST DEPT#
A 1
B 2
C 3
D NULL
E 4
F NULL
G 5
H 6
I NULL
Then i have the second table which have the combination of host in alphadetical order
subject
A,B
B,C
A,B,C
A,B,D
D,E
D,F,H
.
.
.
.
I need the folowing result
subject result
A,B 1
B,C 2
A,B,C 1
A,B,D 1
D,E 4
D,F,H 6
the subject from table Z check the correspinding value of the series of string ie a,b or d,e etc and return the value in the result column by looking at the X table. If the value of first string is null than it will go to the the second string and return that value
eg
D , F ,H this string will return the value of H as String D and String F are null. So the value is 6
I think I had made my requirement clear
Can anyone help
thanks in advance
I have two tables X and Z
TABLE X
HOST DEPT#
A 1
B 2
C 3
D NULL
E 4
F NULL
G 5
H 6
I NULL
Then i have the second table which have the combination of host in alphadetical order
subject
A,B
B,C
A,B,C
A,B,D
D,E
D,F,H
.
.
.
.
I need the folowing result
subject result
A,B 1
B,C 2
A,B,C 1
A,B,D 1
D,E 4
D,F,H 6
the subject from table Z check the correspinding value of the series of string ie a,b or d,e etc and return the value in the result column by looking at the X table. If the value of first string is null than it will go to the the second string and return that value
eg
D , F ,H this string will return the value of H as String D and String F are null. So the value is 6
I think I had made my requirement clear
Can anyone help
thanks in advance