I have a requirement to take the output from the following and use it in an 'IN' Statement in a second query
SELECT
MPFlist
FROM My_Table_01
WHERE Reference = <Variable>
Where the Value of MPFlist is returned as (as an example) NB this list could return a variable number of MPF codes
'LCADL','LCECC','LCHBK','LCHIN'
One of my problems is that I have Read Only Access to the MS SQL DB in question.
What I need to do is somehow split this output so it can be used in another query
In other Words I want this
SELECT
Product,
Company,
Circuit
From My_Table_02
WHERE MPFID IN
(
SELECT
MPFlist
FROM My_Table_01
WHERE Reference = <Variable>
)
to run as this
SELECT
Product,
Company,
Circuit
From My_Table_02
WHERE MPFID IN
(
'LCADL','LCECC','LCHBK','LCHIN'
)
TIA for any suggestions