"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
It sounds like sale_id in your table should be the primary key on the table and be set to auto-increment. Since it also sounds like there's not a lot of data already in the table, why not recreate it with the sale_id setup to handle this for you, insert the data into the new table and then rename the tables to swamp them? CREATE TABLE `TableNew` LIKE `TableOld`; ALTER TABLE `TableNew` MODIFY COLUMN `sale_id` INTEGER NOT NULL DEFAULT 0 AUTO_INCREMENT; INSERT IGNORE INTO `TableNew` (cust_id, Sales_desc, bla, bla) SELECT cust_id, Sales_desc, bla, bla FROM `TableOld`; RENAME TABLE `TableOld` to `TableOldBackup`; RENAME TABLE `TableNew` to `TableOld` Note: In the insert statement given in this answer, you must specify all the fields to be copied over and exclude sale_id from the insert.
That way mysql will populate sale_id with the auto-incremented values.
It sounds like sale_id in your table should be the primary key on the table and be set to auto-increment. Since it also sounds like there's not a lot of data already in the table, why not recreate it with the sale_id setup to handle this for you, insert the data into the new table and then rename the tables to swamp them? CREATE TABLE `TableNew` LIKE `TableOld`; ALTER TABLE `TableNew` MODIFY COLUMN `sale_id` INTEGER NOT NULL DEFAULT 0 AUTO_INCREMENT; INSERT IGNORE INTO `TableNew` (cust_id, Sales_desc, bla, bla) SELECT cust_id, Sales_desc, bla, bla FROM `TableOld`; RENAME TABLE `TableOld` to `TableOldBackup`; RENAME TABLE `TableNew` to `TableOld`; Note: In the insert statement given in this answer, you must specify all the fields to be copied over and exclude sale_id from the insert.
That way mysql will populate sale_id with the auto-incremented values.
Thanks for updating with this mysql query..... – shahid Feb 4 at 14:35.
This may do the trick: UPDATE tableName, (SELECT @id := 0) dm SET sale_id = (@id := @id + 1).
A much more elegant solution than mine. – Manzabar Feb 3 at 20:10 1 Friend, I have some doubt with your mysql_query.....what should I mention in place of @id and what is dm plz – shahid Feb 4 at 14:32 Woh! You are really great,,,,you helped me lot regenerating serial no..Thanks – shahid Feb 4 at 14:35.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.