Hi @udapud
Your code will not work because you are using get_sub_field OUTSIDE of the has_sub_field loop.
It MUST be used within the loop, otherwise, how would your code know which row to fetch the data from?!
Please read over the docs for more information about the functions you are using