how generate sequence mysql?
(n.b. :- each unique pair sequence generated afresh)
1,1 -- 1
1,1 -- 2
1,1 -- 3
1,2 -- 1
1,2 -- 2
1,3 -- 1
1,4 -- 1
1,4 -- 2
1,4 -- 3
you need row_number
function in sql server mysql
select @row_number := case when @conc_no = conc @row_number + 1 else 1 end num, @conc_no := mydata.conc conc ( select concat(num1, ",", num2) conc table1 order num1 asc, num2 asc ) mydata
Comments
Post a Comment