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 Quote
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. Quote
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. Quote
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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.