MySQL Forums
Forum List  »  Microsoft SQL Server

SQL Server Triggers - MySQL Triggers (Auto Incrementing/Insert friendly)
Posted by: T Irish
Date: June 15, 2011 02:49PM

Is it possible to create a column that automatically increments in such a way that I can insert values, provide a value for the incremented column and than the rest of the values in that column adjust automatically?

For example, if I have an index column and a data column such that:

INDEX -- DATA
1 -- ONE
2 -- TWO
3 -- THREE
4 -- FOUR

Is there a way to insert (3, NEW THREE) so the result is:

INDEX -- DATA
1 -- ONE
2 -- TWO
3 -- NEW THREE
4 -- THREE
5 -- FOUR

Thanks!
This issue has been solved using SQL Server, but now I need it in MySQL. Look Here.

Options: ReplyQuote


Subject
Written By
Posted
SQL Server Triggers - MySQL Triggers (Auto Incrementing/Insert friendly)
June 15, 2011 02:49PM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.