Path: utzoo!attcan!uunet!midway!ncar!gatech!bloom-beacon!eru!hagbard!sunic!lth.se!abblund!abblund.se!erik From: erik@abblund.se (Erik Sparre) Newsgroups: comp.databases Subject: How to change each row in a table using SQL ? Message-ID: <1990Oct25.081639.14155@abblund.se> Date: 25 Oct 90 08:16:39 GMT Sender: erik@abblund.se (Erik Sparre) Organization: ABB Corporate Research, Lund, Sweden Lines: 31 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 example: Start time was 12:32 and landing time was 13:45. The elapsed time should be 1:13, but was entered as 13:45 I can see two possibilities. Either doing the change with an SQL-statement, or writing a program to do it. I haven't much experience with SQL, so maybe you could give me some hints on how to solve it in SQL or with a program using SQL facilities. Oh, BTW, I'm using ORACLE. This is a private posting and has nothing to do with ABB. Thanks in advance ! -- Erik Sparre | Email erik@abblund.se ABB Corporate Research | Phone +46 46 168527 Dept. KLL, Lab for Man-Machine Communication | Telex 33709 IDEON Research Park, S-223 70 LUND, SWEDEN | Fax +46 46 145620