Skip to main content
deleted 2 characters in body
Source Link
Andriy M
  • 23.2k
  • 6
  • 59
  • 103

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date        min_temp  max_temp
----------  --------  --------
2016-05-01  17.8      43.2

I would like to have a date for the max_valuemax_temp and a date for the min_valuemin_temp.

How can I do it?

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date        min_temp  max_temp
----------  --------  --------
2016-05-01  17.8      43.2

I would like to have a date for the max_value and a date for the min_value.

How can I do it?

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date        min_temp  max_temp
----------  --------  --------
2016-05-01  17.8      43.2

I would like to have a date for the max_temp and a date for the min_temp.

How can I do it?

formatting
Source Link
Andriy M
  • 23.2k
  • 6
  • 59
  • 103

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date : 2016-05-01
min_temp: 17.8
max_temp : 43.2

date        min_temp  max_temp
----------  --------  --------
2016-05-01  17.8      43.2

I would like to have a date for the max_valuemax_value and a date for the min_valuemin_value.

How can I do it?

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date : 2016-05-01
min_temp: 17.8
max_temp : 43.2

I would like to have date for the max_value and date for the min_value.

How can I do it?

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date        min_temp  max_temp
----------  --------  --------
2016-05-01  17.8      43.2

I would like to have a date for the max_value and a date for the min_value.

How can I do it?

deleted 32 characters in body
Source Link
Julien Vavasseur
  • 10.2k
  • 2
  • 28
  • 46

I'mI am trying to get maxthe MAX and minMIN values for the current month and the dates for these values I'm.

I am getting the maxMAX and minMIN values but I'mI am not getting the dates for these values, instead. Instead I get the first day of the month. Here

Here is is my request query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date : 2016-05-01 min_temp: 17.8 max_temp : 43.2

date : 2016-05-01
min_temp: 17.8
max_temp : 43.2

I would like to have date for the max_value and date for the min_value.

Anyone whoHow can help me would be very kind, because i'm stuck.

Thank you

jeromeI do it?

I'm trying to get max and min values for the current month and dates for these values I'm getting the max and min values but I'm not getting dates for these values, instead I get the first day of the month. Here is is my request :

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is I get:

date : 2016-05-01 min_temp: 17.8 max_temp : 43.2

I would like to have date for the max_value and date for the min_value.

Anyone who can help me would be very kind, because i'm stuck.

Thank you

jerome

I am trying to get the MAX and MIN values for the current month and the dates for these values.

I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the first day of the month.

Here is is my query:

SELECT  DATE(CREATED) AS date
      , MIN(ROUND(AMBIENT_TEMPERATURE,1)) AS min_temp
      , MAX(ROUND(AMBIENT_TEMPERATURE,1)) AS max_temp
FROM WEATHER_MEASUREMENT
WHERE (MONTH(DATE(CREATED)) = Month(NOW()));

And this is what I get:

date : 2016-05-01
min_temp: 17.8
max_temp : 43.2

I would like to have date for the max_value and date for the min_value.

How can I do it?

edited title
Link
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531
Loading
added 16 characters in body
Source Link
Loading
Source Link
JEROME C
  • 21
  • 1
  • 1
  • 2
Loading