Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 MySQL 中编写一个搜索我们编写示例的 UserId 的过程
call NEW_PROCEDURE(2)
where 2 = UserId我们希望在所有表中搜索。我有一个想法,但我不知道怎么做。首先,我们必须搜索数据库中的所有列 wherecolumn_name = UserId和 其次,我们必须搜索我们在过程中调用的值,并且UserId = our value
where 2 = UserId
column_name = UserId
UserId = our value
有人可以帮助我吗?
这会给你一个想法http://beyondrelational.com/modules/2/blogs/70/posts/10883/search-a-value-in-character-column-of-all-tables.aspx
1 Use concat instead of + 2 Use prepared statement to exeucte the query 3 Information_schema is supported in mysql too