Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-05-15
4
Medium Priority
?
330 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 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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

877 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