Path: utzoo!attcan!uunet!nih-csl!lhc!adm!husc6!yale!cs.utexas.edu!titan!drack From: drack@titan.tsd.arlut.utexas.edu (Dave Rackley) Newsgroups: comp.databases Subject: Re: How to change each row in a table using SQL ? Message-ID: Date: 26 Oct 90 13:14:10 GMT References: <1990Oct25.081639.14155@abblund.se> Sender: news@titan.tsd.arlut.utexas.edu Organization: Applied Research Laboratories, University of Texas at Austin. Lines: 37 In-reply-to: erik@abblund.se's message of 25 Oct 90 08:16:39 GMT In article <1990Oct25.081639.14155@abblund.se> erik@abblund.se (Erik Sparre) writes: [stuff deleted] > 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 You're real close! Use the update command: update table_name set elapsed time = elapsed_time - start_time; You may have to use the ORACLE function to_date() if the fields in question are NOT already in ORACLE date format. Hope this helps. :-) -- DISCLAIMER? I don't know anything 'bout any ol' disclaimer! +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+ | David Rackley | | | Applied Research Laboratories | Remember, you can tuna fish, | | The University of Texas | But you can't tuna piano! | | Austin, TX. 78758 | | +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+