Link to home
Start Free TrialLog in
Avatar of divinemr
divinemr

asked on

Function/proceedure to Generate mysql number between 2 ranges

For example,
select gennum(0,1);
returns either 0,1

This is to be used as follows:
select spaces(gennum(0,1));

Obviously the result has to be in whole numbers as the spaces function will only accept whole numbers.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of divinemr
divinemr

ASKER

Can you please make it a bit more like:

select spaces(0,3) # Generates either no spaces, 1, 2 or 3 spaces
Nevermind, I got it .. thanks
You're welcome.