# MySQL :: How to return update value?



## mikeb88 (Jul 17, 2008)

I'm doing the following:



```
INSERT INTO ordernumber (id,count) VALUES (123,1) ON DUPLICATE KEY UPDATE count=count+1
```
what I would like to know is what the "count" value is after this operation. is it possible to include some kind of SELECT in this query so that I will know what the "count" value is in the end? 
ideas?


----------



## Chicon (Jul 29, 2004)

Hi mikeb88,

There's no way to embed a _SELECT_ request within an _INSERT_ statement the way you want.
You have to make a separate one like :
_SELECT max(count) FROM ordernumber WHERE id = 123_


----------

