2

The following query gives me a list of 1222 distinct columns:

select distinct column_name from information_schema.columns where table_name like 'fea_var%';

I want to create one base table which has all the 1222 rows from this query as columns. fea_var% tables are just empty tables with columns.

So, the output should be an empty table with those 1222 columns.

John K. N.
  • 18,854
  • 14
  • 56
  • 117
Reshmi Nair
  • 31
  • 1
  • 3

1 Answers1

3

I am not sure why you need to do this. Since your are querying information_schema I assume there are tables or a table which correspond to the 'fea_var%' condition. You could join these tables and set a condition that make sure no row is returned. Lets say you have two tables fea_var1 and fea_var2. Something like:

select * from fea_var1,fea_var2 where 1=2;

You should get all columns of both tables and no rows, if that is what you are looking for.

Björgvin
  • 238
  • 2
  • 6