0

I'm facing a scenario, where if the input is 10, I want a sequence of numbers (1,2,3,...10).

In oracle the level function provides that function, and I wish to know how to perform the same task in MySQL.

Thanks...

Aashick
  • 91
  • 2
  • 15

1 Answers1

0

You can Use this query in mysql

SET @rownr=0;
SELECT @rownr:=@rownr+1 AS `rowNumber` FROM `tablename` limit 10

the above query generate sequence of that number upto the limit. Tablename is any of your table in db

Kannan Chakkara
  • 181
  • 4
  • 16