I have the following data in a single table:
I need a SQL query that can combine the data to append url1 to the batch row and url2 to the single row. Could I use the KNO column to create some sort of matching information?
Result:
Advertisement
Answer
I found another solution using INNER JOIN
. I modified the kno
column of the “applyPages” Rows to contain the corresponding process name, then I joined them on that column:
SELECT kname, kno, kvalue, url FROM (SELECT kname, kvalue FROM mytable WHERE kname='ProcessName%') A INNER JOIN (SELECT kname,url, kno FROM mytable WHERE kname='ApplyPage') B ON A.kname = B.kno