How to update column with data from other table using SQL
From: Alan S <ajs6695_at_jps.net>
Date: Mon, 14 Jun 1999 06:25:52 -0700
Message-ID: <37656f56_at_news1.jps.net>
[Quoted] I have two tables where one of them (MASTER_PATIENT_INDEX) has a column named EPINUM which I want to replace with the data in each column with a new number.
Date: Mon, 14 Jun 1999 06:25:52 -0700
Message-ID: <37656f56_at_news1.jps.net>
[Quoted] I have two tables where one of them (MASTER_PATIENT_INDEX) has a column named EPINUM which I want to replace with the data in each column with a new number.
A second table has OLDEPI and NEWEPI for columns. OLDEPI and EPINUM are the values that need to be linked. I have tried several SQL statements (listed below), but to no avail.
UPDATE MASTER_PATIENT_INDEX SET MASTER_PATIENT_INDEX.EPINUM =
EPI_NUMBERING.NEWEPI
WHERE MASTER_PATIENT_INDEX.EPI IN
(SELECT EPI_NUMBERING.OLDEPI
FROM EPI_NUMBERING, MASTER_PATIENT_INDEX
WHERE EPI_NUMBERING.OLDEPI = MASTER_PATIENT_INDEX.EPINUM);
UPDATE MASTER_PATIENT_INDEX SET MASTER_PATIENT_INDEX.EPINUM =
EPI_NUMBERING.NEWEPI
WHERE MASTER_PATIENT_INDEX.EPINUM = EPI_NUMBERING.OLDEPI;
What could I try?
Thank you,
Alan Received on Mon Jun 14 1999 - 15:25:52 CEST