|
You will need to run 2 separate SQL statements update PRE_CASE as A set (A.PATIENT_NAME) = select COALESCE(B.PATIENT_NAME, A.PATIENT_NAME) from DEMOGRAPHIC as B where A.MEDICAL_RECORD_NO = B.MEDICAL_RECORD_NO then run a second one but substitute POST_CASE for PRE_CASE Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxx midrange-l-bounces@xxxxxxxxxxxx wrote on 03/08/2007 04:05:47 PM:
This isn't a midrange specific question. But, it is SQL, so I thought somebody with more SQL knowledge could offer a suggestion. This is MS-SQL. I have three tables. There are common columns between the three tables. The common fields are MEDICAL_RECORD_NO and PATIENT_NAME The main table is DEMOGRAPHIC, where all name corrections have been
performed.
The other two tables have subtle changes in the name field. What would the SQL statement be to update the PATIENT_NAME columns in
PRE_CASE
and POST_CASE tables, from DEMOGRAPHIC table, where MEDICAL_RECORD_NO is equal? I am assuming that a WHERE could also be applied where only a specific MEDICAL_RECORD_NO from DEMOGRAPHIC would be used. I could see running this as two separate UPDATE operations. Might even
be
preferable. Thanks for any assistance. John McKee -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.