Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How to get minimum values from another table during ETL

Hi all, I have a customer table where I have one record for each customer, and I have an order table where I have multiple orders for each customer. To my master table, I would like to add a new column as the minimum order date.

 

Customer_master:

Customer_ID

X

Y

 

 

Order table

Customer_ID Order_Date Quantity

X 5-Jan-2023 23

X 8-Jan-2023 15

Y 7-Feb-2023 36

Y 4-Feb-2023 21

Y 11-Feb-2023 99

 

In the end I want my customer table to look like this (New column addition)

Customer_ID First_Order_Date

X 5-Jan-2023

Y 4-Feb-2023

 

Thanks a lot in advance

 

 

3 Replies