Skip to content
Advertisement

Insertion of dynamic values to specific colums using SQL

I’m trying to insert a new row into a table, but one column’s value insertion is dependent on a specific rule. So far I get an error because SQL doesn’t support my way and I have no idea what to do:

How can I insert the max(RNFIL170.SEDER_HATZAGA)+1 into RNFIL170 ?

Advertisement

Answer

use INSERT INTO ... SELECT.. synxtax

Always specify the column list in the destination table

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