I am bit new to MySQL. I am trying to create a mysql function that will produce and output a query with a single column with values from 1 to that given number.
Start of the function looks like,
create function get_NumberSequence (n)
Suppose I call the function as,
select get_NumberSequence(5);
I should get the output like below.
Sequence
--------
1
2
3
4
5
I tried an approach to combine and store queries like,
@num:=(select 1 as Sequence)
@num:=@num union (select 2 as Sequence)
This didn't work for me.