I'm working with a database, where one of the fields I extract is something like:
1-117 3-134 3-133
Each of these number sets represents a different set of data in another table. Taking 1-117
as an example, 1
= equipment ID, and 117
= equipment settings.
I have another table from which I need to extract data based on the previous field. It has two columns that split equipment ID and settings. Essentially, I need a way to go from the queried column 1-117
and run a query to extract data from another table where 1 and 117 are two separate corresponding columns.
So, is there anyway to split this number to run this query?
Also, how would I split those three numbers (1-117 3-134 3-133
) into three different query sets?
The tricky part here is that this column can have any number of sets here (such as 1-117 3-133
or 1-117 3-134 3-133 2-131
).
I'm creating these queries in a stored procedure as part of a larger document to display the extracted data.
Thanks for any help.