This is a discussion on Select field.type, field.referenced table_name from I S table within the MySQL Database forums, part of the Database Forums category; Hi, I am trying to get field type + refrenced_table_name in 1 SQL hit, but not having much luck. Anyone know ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
SELECT information_schema.columns.column_name,
information_schema.columns.data_type, information_schema.KEY_COLUMN_USAGE.COLUMN_NAME, information_schema.KEY_COLUMN_USAGE.REFERENCED_TAB LE_NAME FROM information_schema.columns LEFT OUTER JOIN information_schema.KEY_COLUMN_USAGE ON information_schema.KEY_COLUMN_USAGE.table_name = information_schema.columns.table_name AND information_schema.KEY_COLUMN_USAGE.column_name = information_schema.columns.column_name WHERE information_schema.columns.column_key = "MUL" AND information_schema.columns.table_name = 'table' AND information_schema.columns.table_schema = 'database' |