1
iam有一個列表,如列表遞增一個表列的數據|| mySql
id ||計數器
如果我做了什麼(某些情況下)我想計數器的值(在特定ID)的一個增加,目前的IAM這樣做:
//get current value
current_value = select counter from myTable where id='someValue'
// increase value
current_value++
//update table with current value
update myTable set counter=current_value where id='someValue';
目前的IAM運行2個查詢此,請建議我以某種方式一步到位。