Does mysql have such a mechanism? I want to use the result of the previous data and insert a new data. for example, my table has four fields: id, count0, count1, count2; the first piece of data I first query is id1, count01, count12, count23; then I want to insert a new id2 data, count0 and count1, and add 1, respectively, count2 remains unchanged (id2, count02, count13, count23). If you follow the general idea, first query id1 data and obtain count0, count1, count... mysql data
Does mysql have such a mechanism? I want to use the result of the previous data and insert a new data;
For example, I have four fields in this table: id, count0, count1, and count2. The first data item I first queried is id = 1, count0 = 1, count1 = 2, count2 = 3; then I want to insert an id = 2 new data count0 and count1 plus 1, count2 unchanged (id = 2, count0 = 2, count0 = 2, count1 = 3, count2 = 3); in general, I first need to query the data with id = 1, obtain the values of count0, count1, and count2, and then execute the operation, this seems to be a waste of resources,
Now, I want to insert data directly without any queries. what should I do if I use the internal mysql mechanism for direct computation?