By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

increment duplicate sting key

P: n/a
Hi,

Can anyone help me to increment the primary key's value on duplication
without using mysql v 4.1 "on duplicate key" function? I can't
upgrade to use the "on duplicate key" feature so am now running into
the problem of using a string name as the primary key and wanting its
value incremented when I try to add another string with same name.
example.. if I had a column of authors and a column of #books: Jon -2,
Mary-3, and Joe-1. And I want to enter another book base on the
primary key authors..so if I enter Jon, a duplicate error would occur
but I want the book column that match Jon increment by one so Jon-3
occurs and if the author's name is Dave then it'll create a new
primary key "Dave". I'm pretty new to mysql so any suggestions would
be great!

Thanks,
Gena
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.