insert into PREFERENCE_DETAIL (select PROVIDER_ID, PROCEDURE_ID,
'993366' from PREFERENCE_DETAIL where SYSTEM_ID='112344')
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of jmmckee
Sent: Wednesday, December 30, 2009 11:12 AM
To: Midrange Systems Technical Discussion
Subject: Adding a row to selected detail rows with SQL
Given a detail table, PREFERENCE_DETAIL, that has columns headed
PROVIDER_ID, PROCEDURE_ID, RESOURCE_TYPE, and RESOURCE_ID.
Given a second table, PREFERENCE_HEADER, with columns PROVIDER_ID,
PROCEDURE_ID (among others):
Can an item be selectively added to the PREFERENCE_DETAIL table when a
given SYSTEM_ID exists for a particular PROVIDER_ID, PROCEDURE_ID pair?
No information is available on which PROVIDER_ID/PROCEDURE_ID pair has
the first item. I am told that approximately 700
PROVIDER_ID/PROCEDURE_ID pairs are involved.
Is this too muddy?
PREFERENCE_HEADER
PROVIDER_ID
PROCEDURE_ID
PREFERENCE_DETAIL
PROVIDER_ID
PROCEDURE_ID
RESOURCE_TYPE
RESOURCE_ID
PREFERENCE_HEADER
000355 001200
000355 001201
000355 001202
000378 009988
PREFERENCE_DETAIL
000355 001201 112344
000355 001201 223355
If, for example the search item was 112344, and the item to add was
993366, PREFERENCE_DETAIl needs to look like this:
000355 001201 112344
000355 001201 223355
000355 001201 993366
I appreciate 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.