Good Day! I have a question, I am not sure how to search for an answer as I think what I am asking may not exist. If you are aware whether it does or does not exist could you let me know? Thanx in advance!!
(I’m working in MySQL)
Is there a way to write a select statement in SQL that will pull data from one column–>> parse the information (select the first (or second) word from the data) then select the matching Row from a neighbor table. Let me see if I can give an example:
Lets say I have a table that holds personal information about people
One of the columns in the table is a multi-part list of tasks(or procedures) completed for the person. The tasks are simply ID numbers referencing a neighbor table that lists ALL tasks/procedures with descriptions.
So Table1.tasklist might look like this in the row,column → ‘2,14,27’ (which are really ID’s from table2
Then each row in Table2 contains the task description, fee, code etc that I really want to use from the Query.
Table2 sample row1: 2, g36.121, description, 95.00
Table2 sample row2: 3, h52.223, description, 0.00
Table2 sample row3: 27, 99233, description, 65.00
If the Table1.column says ‘2,14,27’, I would like the rows with these ID’s 2,14,27 returned in the search results, well, I’d also like to parse the Table2 rows and really only return 1 or 2 columns for use -
So Table1 holds a list of procedures: 1,14,35 as an example
I’d like to use those ID’s and pull rowID1,14,35 column2,column4 from table2 for use
Man, I am really sorry that was so wordy.
Seems awful complex, any idea if this is possible?