ChrisL Posted August 7, 2010 Posted August 7, 2010 I'm after a little help with an SQL query. I've been trying to find out how you add 1 to every value of a single column in a SQLITE table, I'm sure there is an easier way than querying every row and adding 1 but I'm not having much luck finding out how. I guess you can do something like this... "UPDATE PRODUCTTABLE SET Product +=1;" Is it possible to do this? Ta [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
seandisanti Posted August 7, 2010 Posted August 7, 2010 I'm after a little help with an SQL query.I've been trying to find out how you add 1 to every value of a single column in a SQLITE table, I'm sure there is an easier way than querying every row and adding 1 but I'm not having much luck finding out how.I guess you can do something like this..."UPDATE PRODUCTTABLE SET Product +=1;"Is it possible to do this?Taone query really is the fastest easiest way to do it; but make sure that you have a where statement unless you want every single row updated. i'm not sure if you can do the increment and assign like that though, may have to actually write out "product = product + 1" argumentum 1
ChrisL Posted August 7, 2010 Author Posted August 7, 2010 The answer was "UPDATE PRODUCTTABLE SET Product = Product +1;" [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
seandisanti Posted August 7, 2010 Posted August 7, 2010 The answer was "UPDATE PRODUCTTABLE SET Product = Product +1;"yeah, i figured that would be the case
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now