0

I have 3 tables (janitor, security & manager) which inherited from the user table. enter image description here

What is the query can be used to produce the following result(list all the name of the child tables)? enter image description here

Thank you. Cheer :)

2
  • you want to produce table names which are references of the user table? Commented Jan 24, 2018 at 3:49
  • @EdgarAllanBayron yes :) I hope to produce table names that referencing the user table only.
    – TYL
    Commented Jan 24, 2018 at 3:54

1 Answer 1

1

Try this:

SELECT
table_name
FROM information_schema.KEY_COLUMN_USAGE
WHERE table_schema = 'database_name'
AND referenced_table_name = 'user';

This will list of referenced tables under table 'user'.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.