Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!mips!wdl1.wdl.fac.com!wdl47!eric From: eric@wdl47.wdl.fac.com (Eric Kuhnen) Newsgroups: comp.databases Subject: Re: How to change each row in a table using SQL ? Message-ID: <1990Oct26.153848.6305@wdl1.wdl.fac.com> Date: 26 Oct 90 15:38:48 GMT References: <1990Oct25.081639.14155@abblund.se> Sender: root@wdl1.wdl.fac.com (SUPER USER) Organization: Ford Aerospace Lines: 25 Nntp-Posting-Host: wdl47 erik@abblund.se (Erik Sparre) writes: >I have a problem. >The user entered 900 rows into table. Instead of entering the elapsed time >in hours and minutes he entered the wall clock time of completion. >(The system registers flying times for aeroplanes) >I have the start wall clock time, so it seems possible to recalculate the >erroneous field with a simple expression like: >for each row do > elapsed_time := elapsed_time - start_time >I can see two possibilities. Either doing the change with an SQL-statement, >or writing a program to do it. I just tested this with integers on my INGRES system, but the solution should hold. update set elapsed_time = elapsed_time - start_time You can do this right from the SQL*PLUS command line. "Q"