N
N
Nikita Paskal2017-07-15 17:11:58
MySQL
Nikita Paskal, 2017-07-15 17:11:58

How to choose everything and everywhere?

Hello! I just can't find any solution on the Internet that would do something like this:
SELECT * FROM * WHERE * LIKE %text%
That is, I want to go through all the tables and fields without entering the names of the tables and fields. Is that possible? I hope I explained clearly.
Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
laxikodeje, 2017-07-15
@laxikodeje

Walk through a special service table called a catalog.
Extract from it the names of all your tables in your database.
And you make a separate request for each of them. It is possible to unite requests through UNION
But how do you imagine it in the output?
In one column you will have either numbers, or words, or dates????

A
Alexander Kuznetsov, 2017-07-15
@DarkRaven

You need to refer to INFORMATION_SCHEMA, it has information on all tables.
But in general, this is not true. Since, for the most part, the columns of the tables do not match, you need to aggregate all the data in the required form in the storage - in the same ElasticSearch. And on it already to make a request, so as not to force the base once again. During the aggregation process, it will come up that not all tables are needed, not all fields are needed, etc. (or maybe not, who knows).

Z
zRrr, 2017-07-15
@zRrr

Like this: It will be within the database. SELECT * FROM *

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question