Connecting several banks with mysql loop

Asked

Viewed 45 times

0

good afternoon

My doubt is related to connection to several databases in mysql for reporting

I would like the annual result of the year 2016 in sales, so I want to take the result of each month, but this would require a select for each month and for each bank.. right ? for example: subsidiary 01 month January sold a total 1000,00 subsidiary 01 month of February sold a total of 1000,00 until arriving in December and then do in the branch 02 and branch 03 All this month by month...

Is there a way to make a reduced code ? I want to make a View for this.. but the logic of the code for me is not very clear.

  • From what I understand sales are in a single table, I did not understand the part of multiple data, if you can be more clear.

  • are several companies, subsidiaries, each with their bank, I would join everything in a single bank, even if temporary

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.