I have two tables, with the same fields in both (I know what you are thinking, but I inherited this from someone else...!). I need to link them as they contain useable data in both tables. For instance SPO2Meas is the field name but I can't work out how to reference this to the first table PE29_AOCResults and not to PE29_AOCScores.
In other words, how can I make it work like table1.fieldname as newfieldname
hope this helps, here is the script.
PRFUniqueId as %KEY_PRFUID,
//WHERE IncDate >= DateAdd(month,-48,GETDATE())
aor.PRFUniqueId = prf.PRFUniqueId
aos.PRFUniqueId = aor.PRFUniqueId
FROM TCMPRF.dbo."PE29_AOCResults" aor
(SELECT PRFUniqueId FROM TCMPRF.dbo."PE29_AOCResults"