Jump to content

Numeric Function Issue Mysql


Moloney

Recommended Posts

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 by Stephenius
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...