MySQL基礎查詢語句

leon830216發表於2015-04-22
1、查詢指定資料庫中所有主外來鍵關係
select concat(table_name, '.', column_name) as 'foreign key', concat(referenced_table_name, '.', referenced_column_name) as 'references' from information_schema.key_column_usage where table_schema='redmine' and referenced_table_name is not null;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22558114/viewspace-1591375/,如需轉載,請註明出處,否則將追究法律責任。

相關文章