2016-05-20 56 views

回答

0

这是它是如何做:

use information_schema; 

SELECT * from key_column_usage 
WHERE referenced_table_name = 'table_name' # table that contains the primary key 
and 
referenced_column_name = 'id'; # the primary key in that table 

这是要给你拥有所有的细节的表格。

+0

谢谢你的答案,它的工作原理与我想要的完全一样。 – user3717278

+0

因为解决方案有效,你能接受答案吗? –

+0

是的,我已经接受了答案,接下来我应该怎么做? – user3717278