1
Answer

Insert into from one to another table with different value

Photo of Goran Bibic

Goran Bibic

5y
754
1
I try to explane 
 
I have this
  1.  INSERT INTO dbo.nalog_knjizenje_stavke (redni_broj, konto, naziv_konta, duguje, potrazuje, id_fakture)  
  2. select  ROW_NUMBER() OVER (ORDER BY redni_broj), konto, naziv_konta, '0.00','0.00', (select MAX(id) from dbo.nalog_knjizenje_lista) as id_fakture  
  3. from dbo.kontni_plan   
  4. where broj_dokumenta = 2301 
Result is next
 
 
That is ok. 
 
Now question, ho to put inside differtent value in last two column when are   different column konto.
 
Every my result not ok
  
Need help and need result to be example
 
 
Thank you

Answers (1)