How to achieve "merge" of two data sets with Insert SQL statemen (Oracle DBMS)t?
Posted
by Roman Kagan
on Stack Overflow
See other posts from Stack Overflow
or by Roman Kagan
Published on 2010-06-02T23:06:43Z
Indexed on
2010/06/03
1:04 UTC
Read the original article
Hit count: 207
Hi:
What would be the insert SQL statement to merge data from two tables. For example I have events_source_1 table (columns: event_type_id, event_date) and events_source_2 table (same columns) and events_target table (columns: event_type_id, past_event_date nullalbe, future_event_date nullable).
Events_source_1 has past events, Events_source_2 has future events and resultant events_target would contain past and future events in the same row for same event_type_id. If there is no past_events but future_events then past_event_date won't be set and only future_event_date will be and the opposite is true too.
Thanks a lot in advance for helping me resolving this problem.
© Stack Overflow or respective owner