Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MySQL: MIN() and MAX() and MAX()-MIN() Inacurate

Posted on 2013-05-15
4
Medium Priority
?
329 Views
Last Modified: 2013-05-16
In this example, I want to get the minimum and maximum values of a matching column, as well as the difference between them.

However the results do not match the values in the database.

http://sqlfiddle.com/#!2/d93a2/3
0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 41

Expert Comment

by:Sharath
ID: 39169716
I didn't get the question. What is the expected value?
0
 
LVL 16

Author Comment

by:hankknight
ID: 39169894
The value of:
BIDMIN_SHOULD_BE_0_94693
Should be:
0.94693

The value of:
BIDMAX_SHOULD_BE_0_94793
Should be:
0.94793

The value of:
BID_RANGE_SHOULD_BE_0_001
0.001

http://sqlfiddle.com/#!2/d93a2/3
0
 
LVL 41

Accepted Solution

by:
Sharath earned 2000 total points
ID: 39170535
Do you want to round to 5 digits?
see this. http://sqlfiddle.com/#!2/d93a2/10
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39171590
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question