how to select max and min?

Let’s learn how to select max and min. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

SQL Select rows with max and min date

I am trying to get 2 rows from a table at one shot. The one with the minimum datetime (today - 7) of last week and the one which is the latest (today). My table: |id |dataIn |dataOut|date |MachineId | -----+-------+-------+-----------------------+-------------------------------------+ |1 |5006 |58 |2011-10-25 09:03:17.000|7B788EE88E-6527-4CB4-AA4D-01B7F4048559 |2 |1200 |130 |2011-10-26 12:45:43.000|7B788EE88E-6527-4CB4-AA4D-01B7F4048559 ... |124 |1350 |480 |2011-10-29 13:29:04.000|7B788EE88E-6...

Answer:

you can use this: select * from dbo.myDatabase where ([Date] = (select max([Date]) from /* your query...

Read more

user798612 at Stack Overflow Mark as irrelevant Undo

Other solutions

SPSS - how to select for cases with a min/max answers chosen in multiple response Q?

I have a few multiple choice questions where respondents were asked to select a maximum of 5 choices (out of a list of 15). I've now imported the data into SPSS and have found that some respondents selected more than 5 choices. Is there a way to select...

Answer:

SPSS (originally, Statistical Package for the Social Sciences) was released in its first version in...

Read more

S. Neave at Yahoo! Answers Mark as irrelevant Undo

MIN() and MAX() in mysql returing wrong values?

I have a table in MYSQL to track movies. The two fields I am interested in at this time are mlength (INT) (entered in minutes i.e. 98) and Name. When I query to find the MIN time it works ok: SELECT MIN(length) FROM movie; If I add this: SELECT mname...

Answer:

From what I understand you need to get either the name of the minimum or maximum entry length from the...

Read more

Joe Smith at Yahoo! Answers Mark as irrelevant Undo

Finding max and min

I have a problem I need help with. I have a row of numbers on the top row. i.e. 15 20 25 40 50 80 100 150 200 250 300 400 450 500 600 750. I would like to fill up the min and max column with numbers such that for the 3rd row, min will be 50 and max...

Answer:

Sorry I don't quite understand your question. "I have a row of numbers on the top row. i.e. 1...

Read more

Miningco.com Mark as irrelevant Undo

What's wrong with my code for the Min, Max and Average in C++?

: Min-max Write a program that takes numbers from the user until they type "0". Using conditional statements, track theminimum value, the maximum value and calculate the average. You may only use the following variables for this program - no...

Answer:

int main() { int n= 0,m; int x = 0; double total= 0, average; float min= 100; float max=0; do { cout...

Read more

Samah Tahir at Yahoo! Answers Mark as irrelevant Undo

Visual Basic 2010- How to make arrays calculate min, max, and average?

Option Explicit On Option Strict On Module MinMax Sub Main() ' Declare a named constant for array size here Const MAX_NUMS As Integer = 10 ' Declare array here Dim numbers() As Integer = {33, 12, -6, 1001, 57, -1, 999, 365, 921, 724} 'Dim num1 As Integer...

Answer:

I honestly have no idea what you were trying to do with the commented code, but isn't what you need...

Read more

Midnite at Yahoo! Answers Mark as irrelevant Undo

Which weather station device can track min/max values for individual days?

i am looking for a weather station device to track outdoor temperature and humidity. the features i want: support at least 2 remote sensors, temperature, humidity and the min/max values for at least the past 3 days for each sensor (e.g. yesterday's min...

Answer:

Oregon Scientific makes a good one: http://www.ambientweather.com/wmorscwipr… You can look at...

Read more

mmqc at Yahoo! Answers Mark as irrelevant Undo

Answer:

Its better to have more free air within your enclosure, this will help with ensuring your driver doesnt...

Read more

Austin at Yahoo! Answers Mark as irrelevant Undo

Algebra - is the Max and Min features of a TI-83 accurate local min and maxes?

I'm taking college algebra, our instructor tells us that we won't learn how to calculate the local min and local max of polynomial functions because it requires calculus (limits ect), but the TI-83 has a feature that can calculate the local max and local...

Answer:

Both. The calculator works by approximating the location of those maxes and mins - if they turn out...

Read more

Julisamarquez89 at Yahoo! Answers Mark as irrelevant Undo

Answer:

use differentiation as with any other question regarding stationary points. however, you must use the...

Read more

Glen at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.