0

my table1 is :

T1

col1    col2
 A1     C1,C2
 A2     C3,C5,C6
 A3     C4
 A4     C2,C5

and so table 2:

T2

col1    col2        col3
 A1     C1          reaction
 A1     C2          accept
 A2     C5          reaction
 A2     C6          manager
 A4     C2          manager

how to result this?:

query result

col1      col2
 A1       reaction,accept
 A2       NULL,reaction,manager
 A3       NULL
 A4       manager,NULL

please help me?

Mahdi Yousef
  • 195
  • 1
  • 3
  • 12
  • 1
    How is this different than your previous question? http://stackoverflow.com/questions/16507239/join-comma-delimited-data-column – sgeddes Jul 13 '13 at 12:21

1 Answers1

3

Never, never, never store multiple values in one column.

Like you see now this will only give you headaches. Normalize your table T1. Then you can join normally.

It should look like this

col1    col2
 A1     C1
 A1     C2
 A2     C3
 A2     C5
 A2     C6
 A3     C4
 A4     C2
 A4     C5
Community
  • 1
  • 1
juergen d
  • 201,996
  • 37
  • 293
  • 362