MySQL Forums
Forum List  »  Newbie

Re: Find missing columns
Posted by: Jamie Downs
Date: July 04, 2017 11:55PM

Hi Peter,

Thanks very much for showing me how to get the result I need. Unfortunately you raise more questions.

I am coming from a SQL Server background where my query would work. I'm guessing this type of query works differently in MYSQL?

Also. Why doesn't a tradition outer join query work?

SELECT DISTINCT tab.TABLE_SCHEMA, tab.TABLE_NAME, col.TABLE_SCHEMA, col.TABLE_NAME, col.COLUMN_NAME

FROM information_schema.tables tab
LEFT JOIN information_schema.columns col
ON tab.TABLE_NAME = col.TABLE_NAME
and tab.TABLE_SCHEMA = col.TABLE_SCHEMA

where col.TABLE_NAME = 't1'
AND col.COLUMN_NAME = 'c1'
AND col.TABLE_SCHEMA IS NULL;

Thanks again.

Options: ReplyQuote


Subject
Written By
Posted
July 04, 2017 02:55PM
July 04, 2017 03:56PM
Re: Find missing columns
July 04, 2017 11:55PM
July 05, 2017 09:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.