I created table in the database called category where I record prices and I have a column of total . when I insert data in my application source code I cannot include total which is in the database ... how can I be able to insert without including the total that I want to count the total from the list of prices
how to deal with error of data truncated for a column when i insert some records int
Collapse
X
-
Maybe just sum up all prices in a Java-loop?
But I would still try to get the total from the database for consistency reason, maybe they use different rounding etc..
In SQL you could use sum(a) to get the sum of all prices in column a, but then again, if it's soewhere already calculated, use that instead (consistency). Headword: island of data.
Comment