Moloney Posted April 9, 2013 Report Posted April 9, 2013 (edited) Hi, I am just wondering why CEILING(10*RAND()) is giving more than one value sometimes and no values at other times when it is combined with the WHERE clause. On the other hand, if it is just used with SELECT CEILING(10*RAND()); it consistently yields only one value between one and ten. I've copied an image below with some MySQL executions to better illustrate what I mean. Any ideas why this is? [please tell me if this question is not clear] Why do I have to limit the query to 1 --> should it not be only one value returned anyways? Edited September 1, 2013 by Stephenius
Moloney Posted April 12, 2013 Author Report Posted April 12, 2013 Any ideas? It is an abstract question but there must be something in MySQL I don't get.
falkencreative Posted April 12, 2013 Report Posted April 12, 2013 Sorry, I'm not sure what's going on with that -- I would expect "ceiling(10*rand())" to only ever return one value. This sort of question might be better off asked at StackOverflow, where you'll have more people with more insight into MySQL's quirks.
Moloney Posted April 13, 2013 Author Report Posted April 13, 2013 okay. thanks for trying. I might join stackoverflow and see. Anyways, I'd say I'll look into it again, post it there & post back here sometime in the future if I get some sort of answer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now