How can I query the database and table based on the column value of a specific field? For mysql & gt; 5, & nbsp; if you know that the value of a field column named book_name is eng-chi-dictionary, how can I query the database name and table name of this field? & Nbsp; SQL & nbsp; what is the statement? Thank you. how can I query the database and table based on the column value of a specific field?
For mysql> = 5, if you know that the value of a field column named book_name is eng-chi-dictionary, how can I query the database name and table name of this field? What is the SQL statement?
Thank you.
MySQL SQL
Share To: = 5 ,?? If you know that the value of a field column named book_name is eng-chi-dictionary, how can I query the database name and table name of this field ?? SQL ?... 'Data-pics = ''>
------ Solution --------------------
Eng-chi-dictionary is the field value.
Select * from information_schema.columns where COLUMN_NAME = 'Book _ name ';
------ Solution --------------------
One-time locating statement!
Although we are not that high, we cannot say we are not.
However, professional teams such as phpmyadmin also use php loops to implement the "search" function.
It can be seen that no such statement is true"
See the db_search.php file.
------ Solution --------------------
Select * from information_schema.columns where COLUMN_NAME = 'Book _ name ';
All tables with the book_name field can be obtained.
Where:
TABLE_SCHEMA is the affiliated database
TABLE_NAME is the table name.
You need to traverse the query results and query the tables one by one to see if book_name contains eng-chi-dictionary.