Click here to Skip to main content
13,142,707 members (55,346 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello friends
i have a problem in mysql this is my Query and i want the result 1

how can i achive this, iam getting 0
Posted 21-Feb-12 0:02am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I believe that the query will always return zero and that is correct based on rule of mathematics. When the decimal part is exactly .5 it returns the whole number as even. That is, 0.50 returns 0 and 1.50 returns 2. In your case, in order for your result to be 1, then the number must be >= 0.51. I hope that helps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 5 Mar 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100