I'm trying to get data from one database and put it in the format of a second database, where the schemas are different. I'm trying to get data that is in multiple rows of one table into a single row, with some logic to change the field names. I will have a unique ID (encounterID), which will be a key in the result table, and is a foreign key in the multiple rows.I'm trying to get data from one database and pu