Min_Chai
(Min Chai)
January 19, 2017, 9:55pm
1
I did an sql like this:
select autocounter() from customers {maxrows 3}
I get 3 rows with number 1, 2, 3
I then rerun the select and now I get 3 rows back with 4,5,6.
How can I get autocounter() to reset back to 1,2, and 3 with my subsequent run of the select statement?
Thanks.
system
(system)
January 19, 2017, 10:04pm
2
There is currently no way to reset the counter back to one. The function was created as an easy way to generate a unique identifier. It is a long integer, and will wrap back around to 0 once it reaches the max.
system
(system)
February 1, 2017, 7:24pm
3
My prior response was not correct. It is possible to reset the counter by using the following SQL statement:
{resetcounter}
Additionally, if you want to seed the counter to a specific value you can use this SQL statement:
{setcounter 123}
Where 123 can be any value.