若作为一个约束条件,从这些表中读取某一字段值呢,有具体的写法么??如:select ID from .....谢谢!!
select * from information_schema.columns where column_key='PRI' and table_name like '%te%';
select * from information_schema.columns where column_name='ID' and table_name like '%te%'; 是这样么?
SELECT COLUMN_NAME FROM information_schema.`TABLES` a INNER JOIN `KEY_COLUMN_USAGE` b ON a.TABLE_NAME=b.TABLE_NAME WHERE a.TABLE_NAME like '%te%'AND CONSTRAINT_NAME='PRIMARY'
select ID from information_schema.columns where column_name='ID' and table_name like '%te%'; 可以读取所有相似表中的ID么?
这样的话,你可以看一下MYSQL手册中关于这个表的说明。
select ID from information_schema.columns where column_name='ID' and table_name like '%te%'; 这样可以的你试试
select * from information_schema.columns where column_name='ID' and table_name like '%te%';
是这样么?
INNER JOIN `KEY_COLUMN_USAGE` b ON a.TABLE_NAME=b.TABLE_NAME
WHERE a.TABLE_NAME like '%te%'AND CONSTRAINT_NAME='PRIMARY'
select ID from information_schema.columns where column_name='ID' and table_name like '%te%';
可以读取所有相似表中的ID么?
这样的话,你可以看一下MYSQL手册中关于这个表的说明。
这样可以的你试试