If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Craeting an ETL table from some tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-09, 09:45
lifzgud lifzgud is offline
Registered User
 
Join Date: Sep 2009
Posts: 6
Craeting an ETL table from some tables

I need to create a table which has columns
Div_no Reg_no Area_no store_no Trans_key sales_units operator_id total sales

we have the following tables
Table-A
Columns-Div_no Reg_no Area_no store_no

Table-B
Columns -Trans_key store_no sales_units

Table-C
Columns -Trans_key store_no sales_units

Table D
Columns-Trans_key store_no operator_id

Table E
Columns-Trans_key store_no operator_id


Table F
Columns-Trans_key store_no operator_id

I need all the trans_key from B and C so i need a UNION of the join to A and B and A and C.I plan to put it in a staging table.I need to do a outer join from A to B because all the store numbers are not present in A .Same goes for A and C .The total sales will be a sum of sales_units group by trans_key.
Then from that staging table i need to join to D,E and F (combined) to get the operator ids and then finally all the data has to be present in a target ETL table.
Could anybody plz help me in framing the query for this?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On