I will like to do the following in snowflake query. Very new to snowflake , from what I have read it seems Snowflake doesn't support loops
I have 2 tables
Table A
Id col1 col2 col3
1 ABC 100 50
2 DEF 200 0
Table B
Date Percentage Name
2021-04-28 .5 XYZ
2021-04-28 .5 ZYX
In my output query I want to split each row in Table A
- the integer columns are split by the Percentage from Table B
- Add Name column from Table B (to represent the split integer value against that particular name
Output
Id col1 col2 col3 Name
1 ABC 50 25 XYZ
1 ABC 50 25 ZYX
2 DEF 100 0 XYZ
2 DEF 100 0 ZYX