Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 11 to 15 of 15 total |
SQL UPDATE that will update a field based on other fields in same record |
Tue, Jul 23 2013 9:43 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< Is that just down to network traffic or something else? >> Yep, just network traffic and turnaround time on each request. Tim Young Elevate Software www.elevatesoft.com |
Wed, Jul 24 2013 10:02 AM | Permanent Link |
John Hay | If there is only 1 record per date then using Fernando's query. If there are multiple records per date add a unique field to the select list/group by and use that (unique key) as the join for the update.
SELECT MyDate, MyAmountPositive, MyAmountNegative, RUNSUM(coalesce(MyAmountPositive,0) - coalesce(MyAmountNegative,0)) AS MyTotal into memory\temp from mytable GROUP BY MyDate; update mytable set mytotal=temp.mytotal from mytable join memory\temp on mytable.mydate=temp.mydate; drop table memory\temp John |
Wed, Jul 24 2013 11:33 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | John
I knew you could do it - how's life in Edinburgh? Roy Lambert |
Thu, Jul 25 2013 5:09 AM | Permanent Link |
John Hay | Hi Roy,
Been very busy with work and lots of golf! Scotland is such a wonderful place when we get a bit of sun (must be especially gorgeous where you are). Hope life is treating you well. John |
Thu, Jul 25 2013 10:42 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | John
>Been very busy with work and lots of golf! Scotland is such a wonderful place when we get a bit of sun (must be especially gorgeous where you are). Nah! To dammed hot. I didn't move up here to sweat all day >Hope life is treating you well. Life is - the economy still isn't but we're being told all the time its improving so there's still hope. Roy |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Monday, May 6, 2024 at 12:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |