It might sound complicated, but it’s not.
I have a table called “orders”, with fields:
id INT(11) auto_increment,
realid INT(14)
Now, I want at every insert into this table, do something like:
INSERT INTO orders VALUES (null, id+1000);
However I’ll be doing it on shop which is currently online, and I want to change everything in 5 minutes. Will something like this work? If not, how do I do that?
I would think a simpler solution would be a calculated column presuming your DBMS supports it (This is using SQL Server syntax, although the MySql syntax should be nearly identical except that you would use
AUTO_INCREMENTinstead ofIdentity(1,1)):Of course, you could also just do it in the presentation or business tier instead of the database.