SQLTeam.com | Weblogs | Forums

Substitute a column value with another columns foreign key value in SQL code

I have trouble in writing a SQL query.

I have a data table with below columns.

DataTable 1

 id     notes
 1      develop document disseminate to {{param = "ac-1_prm_1"}}
 2      develop document  to {{param = "ac-1_prm_2"}}

Data table Parameter

 parameterid     value.                 Id
 ac-1_prm_1      apple doc.         1
 ac-1_prm_2      google doc.       1
 ac-1_prm_3      facebook doc.   2

I need create a final_notes column:

 id  notes                                                       final_notes 
 1   develop document disseminate     develop document disseminate to apple doc and google doc
     to{{param = "ac-1_prm_1"}} 
     and {{param = "ac-1_prm_2"}} 
 2   develop document                           develop document facebook doc 
     to {{param = "ac-1_prm_3"}}