Iterate for each row in SQLITE JDBC Table to update only specific cell values in that row

StackOverflow https://stackoverflow.com/questions/19981800

  •  30-07-2022
  •  | 
  •  

문제

I have to iterate over each row in SQLITE JDBC on-memory table in order to update the cell value of one of the columns using the cell value of another column in the same row.

E.g. For each row in the table, take cell value of column 3, make some minor changes and put this value in cell of column 6 in the same row.

What would be the best approach for this, lie most optimized way of doing this.

So the main question is how to iterate over each row in table. I am not sure if it's a valid question. But would like to know suggestions or perhaps some sample snippet.

올바른 솔루션이 없습니다

다른 팁

You can use any SQL expression in the UPDATE statement:

stmt.executeUpdate("UPDATE MyTable SET Col6 = Col3 + 123");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top