Skip to content
Advertisement

Inserting data into table with select

i`m trying to do something…. I have to insert some data in to a table but….. So here is where I end up…

any suggestion…

Advertisement

Answer

You cannot refer to an alias in the SELECT or WHERE clauses of a sub-query where it is defined. Generate the data in a sub-query (or a sub-query factoring clause) and then refer to it in an outer query:

or:

fiddle

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