MySQL Forums
Forum List  »  Newbie

Re: how to add an auto-increment column to and other column
Posted by: marc-antoine yonga
Date: February 28, 2017 12:24PM

Hello,

After work, I find a solution, I used a variable with an himself autoincrement and I concat it with an other field.

The code is :

SET @RowNum=0;
SELECT @RowNum:=@RowNum + 1, CONCAT_WS('_', T_Cmde_BaseNumCle2, Convert(@RowNum, Char(7))) from t_jp_commande;

and so the autoincrement is ok and the concat function is ok so you can put each variable of the select query in each field of your table.

Options: ReplyQuote


Subject
Written By
Posted
Re: how to add an auto-increment column to and other column
February 28, 2017 12:24PM


Sorry, you can't reply to this topic. It has been closed.

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.