Why don't you set the column type of Quanitty to INT?
then you can do it via update store_house set Quantity = Quantity - 1 where blabla...
Pregunta
i have a row like that :
ID===Name===Price===Quantity
04===LCDs===630===20
now i am trying to subtract 1 or more each time someone buy a LCD from the database
what i am able to do with my knowledge is to :
-get data as a String and convert to int
-then subtract
-then execute this statement "UPDATE Store_HOUSE SET ID=04,Name='LCDs',Price=630,Quantity="+ newValue ;
that works well but iam sure there is a better way ... like if i can specify the exact column that will be changed instead of having to pass the whole row (which is lot more than what's in the Example =\ )to change only one column .
Solución
Why don't you set the column type of Quanitty to INT?
then you can do it via update store_house set Quantity = Quantity - 1 where blabla...