I have SQL Table that looks like this :
select PARAMNAME, PARAMVALUE, INTERFACEID from RTVS_RESPONSE WHERE INTERFACEID IN ('MPN.INQUIRY.DJA')
PARAMNAME PARAMVALUE INTERFACEID billingInfo1 021076427070122 MPN.INQUIRY.DJA billingInfo2 411122 MPN.INQUIRY.DJA billingInfo3 100 MPN.INQUIRY.DJA billingInfo4 03032014 MPN.INQUIRY.DJA billingInfo5 000000000000000 MPN.INQUIRY.DJA billingInfo6 JL.MESJID IV NO.19,JAKARTA UTARA MPN.INQUIRY.DJA billingInfo7 900019191818181778 MPN.INQUIRY.DJA amount 89002 MPN.INQUIRY.DJA customerName NPWP DUMMY DJA MPN.INQUIRY.DJA responseCode 00 MPN.INQUIRY.DJA
And This :
select PARAMNAME, PARAMVALUE, INTERFACEID from RTVS_RESPONSE WHERE INTERFACEID IN ('MPN.INQUIRY.DJBC')
PARAMNAME PARAMVALUE INTERFACEID billingInfo1 021076427070122 MPN.INQUIRY.DJBC billingInfo2 411122 MPN.INQUIRY.DJBC billingInfo3 100 MPN.INQUIRY.DJBC billingInfo4 03032014 MPN.INQUIRY.DJBC billingInfo5 000000000000000 MPN.INQUIRY.DJBC billingInfo6 JL.MESJID IV NO.19,JAKARTA UTARA MPN.INQUIRY.DJBC billingInfo7 900019191818181778 MPN.INQUIRY.DJBC amount 89001 MPN.INQUIRY.DJBC customerName NPWP DUMMY DJBC MPN.INQUIRY.DJBC responseCode 00 MPN.INQUIRY.DJBC
I would like to create a pivot table so that PARAMVALUE
became column name VALUE
.
Like this :
INTERFACEID | billingInfo1 | billingInfo2 | billingInfo3 | billingInfo4 | billingInfo5 | billingInfo6 | billingInfo7 | amount | customerName | responseCode
Fyi, this is a single table. and many other question is asking for joining 2 different table. I don't think it's duplicated to any one else.