Re: Numbering within groups

2003-03-28 Thread gerald_clark
If it is MYISAM: ALTER TABLE projected ADD COLUMN partnumber INT UNSIGNED NOT NULL AUTO_INCREMENT , ADD UNIQUE KEY (projectid,partnumber); If you don't want to keep the automatic incrementing of the partnumber for each project, then drop the key. Renger van Nieuwkoop wrote: Hi I have the follow

Numbering within groups

2003-03-28 Thread Renger van Nieuwkoop
Hi I have the following problem: I have a database with two fields "projectid" and "partner". Here some data: Projectid / Partner 1 / A1 2 / A2 2 / B2 3 / A3 3 / B3 3 / C3 4 / A1 4 / B4 ... I want to number the partners for every project, e.g. Projectid / Partner / Partnernumber 1 / A1/1 2 /