On Wednesday 14 December 2005 16:31, Joseph Alotta wrote: > Greetings, > > I have a bunch of names and addresses that I am adding to MySql > database. I would like to automatically assign a unique sequence > number to each person. Is there a way to do this easily? > > id name > 1 bob jones > 2 larry smith > 3 henry rogers
Create your table like this: CREATE TABLE people ( id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, name CHAR(40), PRIMARY KEY (id) ); and then insert the records like this: INSERT INTO people (name) VALUES ('bob jones'),('larry smith'),('henry rogers'); BTW, I started to learn SQL two days ago... -- Jørn Dahl-Stamnes homepage: http://www.dahl-stamnes.net/dahls/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]