-
How to list table names using primary key of a table
about 9 years ago
-
about 9 years ago
Hi Shikha,
You can use the following queryselect distinct concat(table_name, '.', column_name) as 'foreign key', concat(referenced_table_name, '.', referenced_column_name) as 'references' from information_schema.key_column_usage where referenced_table_name ="your_reference_table_name";
Hope it solves your problem. Thanks
1 Answer(s)