Re: Retrieve most recent of multiple rows

2013-03-14 Thread Johan De Meersman
- 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

Re: Re: Retrieve most recent of multiple rows

2013-03-14 Thread Ananda Kumar
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

Aw: Re: Retrieve most recent of multiple rows

2013-03-14 Thread Stefan Kuhn
> 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

Re: file level encryption on mysql

2013-03-14 Thread spameden
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

Re: Retrieve most recent of multiple rows

2013-03-14 Thread Ananda Kumar
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