i have some problem in BigQuery,
i have 2 tables first tables is paymentSchedule
| ID | index_month | amount |
|---|---|---|
| aaa | 1 | 1000000 |
| aaa | 2 | 2000000 |
| bbb | 1 | 500000 |
| bbb | 2 | 2500000 |
| bbb | 3 | 2000000 |
| ccc | 1 | 2000000 |
second table is BorrowerTable
| ID | Name |
|---|---|
| aaa | Alexa |
| bbb | Jorde |
| ccc | Juan |
and i want to write query using STRUCT and the result that i want is :
| ID | Name | index_month | amount |
|---|---|---|---|
| aaa | Alexa | 1 | 1000000 |
| 2 | 2000000 | ||
| bbb | Jorde | 1 | 500000 |
| 2 | 2500000 | ||
| 3 | 2000000 | ||
| ccc | Juan | 1 | 2000000 |
i already write query but it doesnt work
select *, STRUCT[select * from paymentSchedule where id=BorrowerTable.ID]from BorrowerTable
