How to run sql query inside sql loop

aru

Member
I need to run a program and display the information.

I have a table called Country. fields are
ID
Name.

ID Name
us United States
uk United Kingdom
ind India
esp Spain

I am using ID of country in 'sales' table

say Table 'sales'. fields are
ID,
Amount,
Country.

ID Amount Country
1 10,000 us
2 20,000 ind


I want to display the full country name in the display.

So I called an SQL in a loop.

And then I want to call another sql with that country_id to get Country name

Is it possible?.

Please See the Attachment



sign0085:
 

Attachments

  • TABLE.zip
    6 KB · Views: 161
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…