选择具有“dataname”数据的行/列[重复]

Posted

技术标签:

【中文标题】选择具有“dataname”数据的行/列[重复]【英文标题】:Select a row/column that has a data of 'dataname' [duplicate] 【发布时间】:2013-02-05 03:11:54 【问题描述】:

是否有一个选择查询,我可以在其中找到一个包含名为“Hello”的数据的列。我不是在单个表上寻找数据,而是在整个数据库上寻找数据。

【问题讨论】:

Dynamic SQL 可能会帮助您。还可以查询信息架构以获取所有列名。 见这里:***.com/q/12051216/330315 和这里 ***.com/q/13514509/330315 和这里:***.com/q/1289792/330315 和这里:***.com/search?q=search+all+columns+in+a+database 【参考方案1】:

@aedz:这里有一些建议/提示,基本上这很容易用谷歌搜索:

MSSQL:

SQL Server: Search all tables for a particular GUID http://gallery.technet.microsoft.com/scriptcenter/c0c57332-8624-48c0-b4c3-5b31fe641c58 http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm Search for a string in all tables, rows and columns of a DB http://justgeeks.blogspot.de/2006/10/search-ms-sql-server-for-any-text.html http://www.sqlservercentral.com/Forums/Topic419243-8-1.aspx http://www.mssqltips.com/sqlservertip/1522/searching-and-finding-a-string-value-in-all-columns-in-a-sql-server-table/ http://www.mssqltips.com/sqlservertip/1555/sql-server-find-and-replace-values-in-all-tables-and-all-text-columns/

mysql

Search for all occurrences of a string in a mysql database Search in all fields from every table of a MySQL database MySQL tool that searches for a string in all fields, tables and databases mySQL query to search all tables within a database for a string? http://kedar.nitty-witty.com/blog/search-through-all-databases-tables-columns-in-mysql

【讨论】:

以上是关于选择具有“dataname”数据的行/列[重复]的主要内容,如果未能解决你的问题,请参考以下文章

SQL仅选择列上具有最大值的行[重复]

SQL仅选择列上具有最大值的行[重复]

SQL仅选择列上具有最大值的行[重复]

SQL仅选择列上具有最大值的行[重复]

SQL仅选择列上具有最大值的行[重复]

如何从单个表中选择多个列值相同的行