J
J
JordanBelford2020-05-31 12:23:38
SQL
JordanBelford, 2020-05-31 12:23:38

Is it possible to use the max function with between?

How it is possible to modernize request that from the specified period to find the maximum value?

SELECT * FROM session WHERE date BETWEEN '2020.05.01' AND '2020.07.01'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-05-31
@JordanBelford

SELECT MAX(date) FROM session WHERE date BETWEEN '2020.05.01' AND '2020.07.01'

SELECT TOP 1 date 
  FROM session 
  WHERE date BETWEEN '2020.05.01' AND '2020.07.01'
  ORDER BY 1 DESC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question