Orders from a set of customers
Your task
Given orders with columns order_id, customer, amount, status and placed, and a list of customer names, return the orders placed by any of them. Return only order_id and customer, sorted by order_id ascending.
Examples
orders_from(orders: dataframe, names: list[str]) -> dataframeExample 1
Input
orders_from(orders, ["ada", "cy"])orders
| order_id | customer | amount | status | placed |
|---|---|---|---|---|
| 1 | ada | 120.5 | paid | 2024-01-05 |
| 2 | bo | 80 | refunded | 2024-01-07 |
| 3 | ada | 45.25 | paid | 2024-02-11 |
| 4 | cy | 200 | paid | 2024-02-14 |
| 5 | bo | 15.75 | pending | 2024-03-02 |
| 6 | ada | 60 | paid | 2024-03-19 |
Output
| order_id | customer |
|---|---|
| 1 | ada |
| 3 | ada |
| 4 | cy |
| 6 | ada |