Skip to content
Advertisement

Inserting into table values found from previous query

I have table, let’s say 'ROLEE'., which contain columns ROLE, ACCESSENTRY. I need to find first rows that ACCESSENTRY is equal to ‘A’ and for these rows insert into that table new rows with fetched ‘ROLE‘ and given ACCESSENTRY. So let’s say within this query:

I get 2 rows with values: ADMIN, USER and for these roles (ADMIN, USER) I need to insert

I tried with these, but it does not work:

Advertisement

Answer

Please use below insert statement,

The right way is to specify the column names,

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement