Bluehost.com Web Hosting $6.95

Select field.type, field.referenced table_name from I S table

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 ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-19-2006
Jared
 
Posts: n/a
Default Select field.type, field.referenced table_name from I S table

Hi, I am trying to get field type + refrenced_table_name in 1 SQL hit, but
not having much luck.

Anyone know how to go about joing IS tables?

I will post solution here ounce worked it out.


Reply With Quote
  #2 (permalink)  
Old 12-19-2006
Jared
 
Posts: n/a
Default Re: Select field.type, field.referenced table_name from I S table

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'


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0