Re: How to build sub-sequence ... AUTO_INCREMENT on a sub-key starting with a specific offset?

2008-10-20 Thread Moon's Father
You could create an extra table in order to record the max number of widget,the the ID should alway be 1. On Thu, Oct 16, 2008 at 2:04 AM, Rob Wultsch [EMAIL PROTECTED] wrote: I would do a muli key PK with a after insert trigger to that would change widget_number 1 to 1000. Just my HO... I

How to build sub-sequence ... AUTO_INCREMENT on a sub-key starting with a specific offset?

2008-10-15 Thread D. Dante Lorenso
All, I am developing a service in MySQL that models a service I've already built in PostgreSQL. I'm trying to port over some of my ideas from that platform to MySQL. Here's the setup: Let's say I have 2 tables: 'account' and 'widget'. Each of these tables have a primary key but the

Re: How to build sub-sequence ... AUTO_INCREMENT on a sub-key starting with a specific offset?

2008-10-15 Thread Rob Wultsch
I would do a muli key PK with a after insert trigger to that would change widget_number 1 to 1000. Just my HO... I would use this combo as the primary key, but I hate doing joins with multiple primary keys, so I'll also keep the widget_id for the purpose of making joins easier. Why? Both of