mysql中如何使用sql语句取出某个数据表中的所有字段
展开全部
在Mysql 众多表中查找一个表名或者字段名的 SQL 语句:
SELECT table_name, column_name from information_schema.columns WHERE column_name LIKE 'Name';
下面两种方法也可以查到:
红色代表可选项
SELECT column_name from information_schema.columns WHERE (column_name LIKE ’%searchTerm%’ AND) table_schema = ‘yourDB’
SELECT column_name from information_schema.columns WHERE (column_name LIKE ’%searchTerm%’ AND) table_schema = ‘yourDB’ AND table_name = ‘yourDBTable’
SELECT table_name, column_name from information_schema.columns WHERE column_name LIKE 'Name';
下面两种方法也可以查到:
红色代表可选项
SELECT column_name from information_schema.columns WHERE (column_name LIKE ’%searchTerm%’ AND) table_schema = ‘yourDB’
SELECT column_name from information_schema.columns WHERE (column_name LIKE ’%searchTerm%’ AND) table_schema = ‘yourDB’ AND table_name = ‘yourDBTable’
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询