I have inherited an ugly database design and need to make do the best I 
can within SQL.

I have to outer join two tables with a multi-part key, but the last part 
is optional.  Is there any reasonable way to do this in SQL?  This is 
against an Oracle (version 8 I believe) DBMS if that helps.  The 
following fields are involved in the join

FROM
  pur75raw pur,
  product pro

WHERE
  pur.mfg_firmno = pro.mfg_firmno(+) AND
  pur.label_seq_no = pro.seq_no(+) AND
  pur.revision_no = pro.revision_no(+) AND
  (IF pur.reg_firmno IS NOT NULL THEN pur.reg_firmno = 
pro.reg_firmno(+))  -- This pseudo code or anything like it I have tried 
does not work

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289557
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to