I have two tables Procedures
and ProcedureTypes
.
Procedures
has a column Type
which is a varchar with the values (1, 2), (3, 4), (4, 5) etc...
ProcedureType
has a primary key 'ID' 1 to 9.
ID Description
1 Drug
2 Other-Drug
etc...
ID
is an integer
value and Type
is varchar
value.
Now I need to join these two tables to show the values
ID
in theProcedures
tableProcedureType
in theProcedures
tableDescription
in theProceduresType
table with the value separated by a "-".
For example if he value in Type is (1,2) the new table after join should show values in the description like (Drug-Other Drug)
I have used this query bot to no avail
SELECT * FROM dbo.[Split]((select RequestType from GPsProcedures), ',')
Can anyone tell me how to do it and why the above query is not working