MySQL在数据库表中查询表名和字段名

1.第一种查询方法:

     SELECT table_name, column_name from information_schema.columns WHERE column_name LIKE 'Name';

2.第二种查询方法:

    SELECT column_name from information_schema.columns WHERE column_name LIKE ’%searchTerm%’ AND table_schema = ‘DateDB’

3.第三种查询方法:

    SELECT column_name from information_schema.columns WHERE column_name LIKE ’%searchTerm%’ AND table_schema = ‘DateDB’ AND table_name = ‘DBTable’


你可能感兴趣的:(mysql)