E
E
Evgeny Kolman2018-07-07 13:44:53
MySQL
Evgeny Kolman, 2018-07-07 13:44:53

How to do a SELECT on the entire database of 20 tables?

Good afternoon.
As a novice Java developer, I am writing a web application for myself.
I have 20 tables with the same structure in a bigDB database. I can’t find the solution I need, tell me how to sort the entire database by date without making 20 SELECT queries?
Maybe there is a solution to do this using SQL, or do you still have to write a loop in Java that will iterate over each table?
After all, it somehow hurts to write the name of each of the tables, but what if there are 100 tables?
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2018-07-07
@Evgeny_13

After all, it somehow hurts to write the name of each of the tables, but what if there are 100 tables?
It will hurt even more. Such a structure of the base suggests that you did not think it through initially. What are 20 or 100 identical tables for?

R
Ruslan Fedoseev, 2018-07-07
@martin74ua

https://ruseller.com/lessons.php?id=557
and the like, like "sql for dummies", "introduction to relational databases".
Well, now - hire a programmer;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question