Why query:
SELECT id, MAX(probe_time) AS Expr1
FROM app_states
GROUP BY logon_id
and
SELECT id, MIN(probe_time) AS Expr1
FROM app_states
GROUP BY logon_id
has same id result.
I wish to select row with MAX or MIN time for every user.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m afraid you’ll have to use sub queries here.
BTW, SQLite does interesting optimization on MIN/MAX:
— http://www.sqlite.org/optoverview.html#minmax