Re: Behaviour of auto_increment

2007-07-15 Thread Gary

Andrew Carlson wrote:
I have created a new table, with an auto_increment value.  I would 
like the

first auto_increment value to be 1001. So I -

1) inserted a fake record with an id of 1000
2) alter table tblname auto_increment=1000 (with and without a fake 
record)
3) alter table tblname auto_increment=1001 (with and without a fake 
record)


Mysql  version is 5.0.38 using MyIsam tables.  Can someone explain
auto_increment, more than what is in the manual?  I have read it, and
apparently I am missing something or don't understand it.   Thanks!


mysql> CREATE TEMPORARY TABLE autotest (
   -> id INT UNSIGNED NOT NULL AUTO_INCREMENT, 
   -> name VARCHAR(10) NOT NULL,

   -> PRIMARY KEY (id))
   -> AUTO_INCREMENT = 1001;

mysql> INSERT INTO autotest (name) VALUES ('Gary'), ('Andrew'), ('Paul');
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM autotest;
+--++
| id   | name   |
+--++
| 1001 | Gary   |
| 1002 | Andrew |
| 1003 | Paul   |
+--++
3 rows in set (0.01 sec)


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Mysql@lists.mysql.com

2007-07-15 Thread m . verdon




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Behaviour of auto_increment

2007-07-15 Thread Paul DuBois

At 5:34 PM -0500 7/15/07, Andrew Carlson wrote:

I have created a new table, with an auto_increment value.  I would like the
first auto_increment value to be 1001. So I -

1) inserted a fake record with an id of 1000
2) alter table tblname auto_increment=1000 (with and without a fake record)
3) alter table tblname auto_increment=1001 (with and without a fake record)

Mysql  version is 5.0.38 using MyIsam tables.  Can someone explain
auto_increment, more than what is in the manual?  I have read it, and
apparently I am missing something or don't understand it.   Thanks!


We could probably explain it better if you said just what it is you're
wondering about.  For example, did the things you try not work and you're
wondering why?  You didn't say what were the results of your actions,
nor whether they were what you expected.

Please clarify.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Behaviour of auto_increment

2007-07-15 Thread Andrew Carlson

I have created a new table, with an auto_increment value.  I would like the
first auto_increment value to be 1001. So I -

1) inserted a fake record with an id of 1000
2) alter table tblname auto_increment=1000 (with and without a fake record)
3) alter table tblname auto_increment=1001 (with and without a fake record)

Mysql  version is 5.0.38 using MyIsam tables.  Can someone explain
auto_increment, more than what is in the manual?  I have read it, and
apparently I am missing something or don't understand it.   Thanks!

--
Andy Carlson
---
Gamecube:$150,PSO:$50,Broadband Adapter: $35, Hunters License: $8.95/month,
The feeling of seeing the red box with the item you want in it:Priceless.