इसे आजमाएं:
INSERT INTO newTable(someField, counter)
SELECT a.someField, (@rank:[email protected]+1) AS counter
FROM sometable a INNER JOIN
(SELECT @rank :=0) b
इसे आजमाएं:
INSERT INTO newTable(someField, counter)
SELECT a.someField, (@rank:[email protected]+1) AS counter
FROM sometable a INNER JOIN
(SELECT @rank :=0) b