- Original Message -
> From: "Ananda Kumar"
> 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
Mr. stefan,
Thanks for let me know about basic of sql.
But if you see my earlier response, i have given the correct sql
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);
You missed reading my earlier emai
> not all the rows, only the distinct q_id,
The subquery will give all distinct q_ids, but the select from in(subquery)
will give everything, because each row must have a q_id which is returned by
the subquery. The query after all says "select all rows where the q_id is one
of the q_ids occuring
I'm sorry for top-posting, but I think you can achieve the best
practice if you'd encrypt user data with some sort of hash made from
the part of the password, i.e. after user is logged in you can store
personal key for the user in memory for decryption so you have to know
every user password (or pa
not all the rows, only the distinct q_id,
On Wed, Mar 13, 2013 at 8:28 PM, Johan De Meersman wrote:
> --
>
> *From: *"Ananda Kumar"
> *Subject: *Re: Retrieve most recent of multiple rows
>
>
>
> select qid,max(atimestamp) from kkk where qid in (select distinct qid fr