Thank you for your help. Yes there are additional fields and the table is basically a temp data to hold the data before we export it.
I was thinking that a stored procedure may be the best solution as well :) Thank you again for your suggestions and your time. Jim On Wed, Feb 20, 2013 at 6:16 AM, André Knappstein < [email protected]> wrote: > ** > > > > > I have a table (see below) where I want to combine the two totals > > below into the 0304KZ6 total so that I can end up with something like > the second example. > > > current 0304KZ6 6786.11 > > 0304KZ6RR 3750.41 > > > desired 0304KZ6 10536.52 > > 0304KZ6RR 0.00 > > Am I correctly assuming that these 2 fields are only an example, and > you probable have more of such constructions? > > Then I'd first try to change the database layout. The above structure > does not seem to be optimal if you need such results more often. > > Then, if you can't change the database, you can try a client approach > (calculate the total of the 2 fields by a routine in your client > application) if you can provide for proper isolation (not having one > field updated while another is read). > > If all of this does not work, consider "execute statement" in PSQL > within a StoredProcedure. It helps me quite well in a similar > situation, even though the experts seem to be quite reluctant about > "execute statement". > > > -- [image: qrcode.5674456.png] [Non-text portions of this message have been removed] ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
