Hello all,
Does anyone knows the author of this:
http://grimoire.ca/mysql/choose-something-else
Title: "Do Not Pass This Way Again"
Thanks a lot,
Marcus Vinicius
On 14-03-2013 12:28, Johan De Meersman wrote:
----- Original Message -----
From: "Ananda Kumar" <anan...@gmail.com>
Subject: Re: Re: Retrieve most recent of multiple rows
select * from tab where anwer_timestamp in (select max(anwer_timestamp) from
tab where q_id in (select distinct q_id from tab) group by q_id);
This is entirely equivalent to
select * from tab where anwer_timestamp in (select
max(anwer_timestamp) from tab group by q_id);
Additionally, there are no double timestamps in the dataset you used, whereas
there are in OP's given dataset.
It's also fairly hard to provide an accurate solution as long as OP hasn't
clarified what exactly they want, really.
--
Marcus Vinicius
http://doutorlinux.com
--
"Havendo suficientes colaboradores,
Qualquer problema é passível de solução"
Eric S. Raymond
A Catedral e o Bazar
"Ubuntu: eu sou o que sou por que você é quem você é;
Humanidade para todos."
Anônimo
"O passado é apenas um recurso para o presente"
Clave de Clau
"O sofrimento é momentâneo; mas
O amor é para sempre"
Parafraseando Wun Dzu
"Ninguém é tão pobre que não possa dar um abraço; e
Ninguém é tão rico que não necessite de um abraço.
Anônimo
"Não fique triste com o que você não tem.
Fique feliz com o que você tem."
Jurema
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql