Solved

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

Posted on 2013-05-15
4
323 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
  • 2
4 Comments
 
LVL 40

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 40

Accepted Solution

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

Expert Comment

by:Ray Paseur
ID: 39171590
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now