Avatar of vijay11

asked on 

please can some one tell the logic

i have 2 tables.1 table have 2 columns.column names are 'child' and 'parent'.'child' have the corresponding 'parent' in each column.a parent can have more than 1 child.2nd table have 2 columns all the 'child' and 'parent' in one column and corresponding display name in the 2nd column.i want a table which is shown below

table 1 is like this

1      a
2      a
3      c
4      d
5      e
6      e
7      e

table 2 is like this

1     apple
2     ball
3     cat
4     dog
a     australia
c     canada
d     denver
e     england

i want table like this
a    null
a    1
a    2
c    null
c    3
d    null
d    4
e    null
e    5
e    6
e    7

Microsoft SQL Server 2005

Avatar of undefined
Last Comment
David Todd

8/22/2022 - Mon