How to check if a table exists in a given schema

Postgres 8.4 and greater databases contain common tables in public schema and company specific tables in company schema. company schema names always start with ‘company’ and end with the company number. So there may be schemas like: public company1 company2 company3 … companynn An application always works with a single company. The search_path is specified … Read more

How can I find all the tables in MySQL with specific column names in them?

I have 2-3 different column names that I want to look up in the entire database and list out all tables which have those columns. Is there any easy script? 1Best Answer 11 To get all tables with columns columnA or ColumnB in the database YourDatabase: SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN (‘columnA’,’ColumnB’) … Read more