Hi,
i have a table where i want to store which id occurs in which table, so the table looks basically like this:
table_name id
t1 1
t1 2
...
t2 150
t2 151
I have been trying to come up with a query that inserst the values accordingly but somehow i can't seem to get it right:
Where the above mentioned error occurs. Then i tried a query like:
But that didn't want to work either. So, i am really happy about any advice...
i have a table where i want to store which id occurs in which table, so the table looks basically like this:
table_name id
t1 1
t1 2
...
t2 150
t2 151
I have been trying to come up with a query that inserst the values accordingly but somehow i can't seem to get it right:
Code:
insert into table_overview(table_name, id)
select 't1', (select distinct id from t1) from t1;
Code:
insert into table_overview(table_name, id)
select 't1', id where id in(select distinct id from t1) from t1;