I have one table with column headers in rows and another table with those values as column names. Every time i need to run dynamic query with pivot to get result. Can you please help?
Table 1: TempColumn
Table 2: Order_Data
Project_IdTemp1Temp2Temp3Temp41818-Order_Number_101-Jan-2021Test DataTest Data1818-Order_Number_202-Jan-2021Test DataTest Data1818-Order_Number_303-Jan-2021Test DataTest Data2323-Order_Number_3302-Jan-2021Test DataTest Data14223-Order_Number_33215-Jan-2021Test DataTest Data
Now i want to map TemColumn from Table 1 with column header of Table 2. (For Ex: I am looking to get data for selected date range and for that i need to map TempColumn with column header of table 2). I don't want to use dynamic query as it is actually time consuming as data present in second have large number of data.