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.
1 Answer 1
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.
-
There are 132 such tables and there are repetitive columns too. Do you have a solution to get only the distinct column names? Separating by commas, usually gives the <table_name>.<column_name> as column names.Reshmi Nair– Reshmi Nair2021年12月17日 14:18:55 +00:00Commented Dec 17, 2021 at 14:18
fea_var%
- is this a biological/genetics issue? Check my profile!