Example:
We have a table
id (auto increment)
test (int unique)
When i do an INSERT the id will count+1 from the last AUTO_INCREMENT
INSERT INTO x id, test ... values null, 1
How can i have test also +1 from the last max value?
Do i need to catch it first?
select test from x where 1=1 order by test DESC LIMIT 1
new_test=result+1
insert null, new_test
or is there a function to tell mysql:
""Hey, i need a new value in this field, do just +1 to the highest value you have till now!""
?
We have a table
id (auto increment)
test (int unique)
When i do an INSERT the id will count+1 from the last AUTO_INCREMENT
INSERT INTO x id, test ... values null, 1
How can i have test also +1 from the last max value?
Do i need to catch it first?
select test from x where 1=1 order by test DESC LIMIT 1
new_test=result+1
insert null, new_test
or is there a function to tell mysql:
""Hey, i need a new value in this field, do just +1 to the highest value you have till now!""
?