0

I have a complicated database that deals with many tables. Some of them are related as in the following table:

enter image description here

Now the requirement is to collect all the corresponding rows in all of the tables from one identifiable field in the entry level table, and download it as CSV.

What comes to my mind is a simple iterative strategy and storing relevant data. But this seems inefficient since the query goes too long and have to iterate it a few times to get everything I need.

Is there any better approach to this problem? I'm using Jsp-Java-spring-MySQL.

mathakoot
  • 1,692
  • 2
  • 14
  • 26
  • Join your tables together, and [export the result as a CSV file](http://www.mysqltutorial.org/mysql-export-table-to-csv/). – Gilbert Le Blanc Oct 06 '15 at 22:38
  • That's the basic idea I have. I do all the long size querying and then export. Is that the best way you think it can be done? – mathakoot Oct 06 '15 at 22:40

1 Answers1

0

I would suggest using a command line of mysql or mysqldump utility(fastest approach) and you can also use a DB tool like Toad or mysql workbench. See if these posts helps :

mysqlworkbench

mysqldump

Community
  • 1
  • 1
Neeraj
  • 1,163
  • 2
  • 18
  • 32