Re: complicated query | no Sub query

2005-05-24 Thread Anoop kumar V
My profound apologies here is the table create structure. the biggest problem i think is that this table does not have any primary keys or atleast unique columns: (I think joins require unique columns) mysql> show create table isr2_aud_log\G *** 1. row ***

Re: complicated query | no Sub query

2005-05-24 Thread SGreen
Anoop kumar V <[EMAIL PROTECTED]> wrote on 05/24/2005 03:02:11 PM: > Thanks Peter - you gave me some ideas... > here is what I have so far (simplified for simplification..) > > select t2.dt_aud_rec, t1.id_secr_rqst from isr2_aud_log t1, isr2_aud_log t2 > where t1.id_secr_rqst=t2.id_secr_rqst > a

Re: complicated query | no Sub query

2005-05-24 Thread Anoop kumar V
Thanks Peter - you gave me some ideas... here is what I have so far (simplified for simplification..) select t2.dt_aud_rec, t1.id_secr_rqst from isr2_aud_log t1, isr2_aud_log t2 where t1.id_secr_rqst=t2.id_secr_rqst and t1.dt_aud_rec > t2.dt_aud_rec group by t1.id_secr_rqst but the problem is tha

RE: complicated query | no Sub query

2005-05-23 Thread Peter Normann
Anoop kumar V wrote: > well - actually it might not be the last 2 days - i just want 2 of > the latest records for every task regardless of what date it is in > the table. Okay, now I think I understand what you need - and if I am correct, this looks like one of the m

RE: complicated query | no Sub query

2005-05-23 Thread Peter Normann
Anoop kumar V wrote: > 1. It returns data about only one id_secr_rqst - I want it to return > data about every id_secr_rqst in the table. So, if I understand you correctly (sorry, having a bad day), you want all records for the past two days? Assuming this, you could u

Re: complicated query | no Sub query

2005-05-23 Thread Anoop kumar V
Thanks Peter - but I see two issues: 1. It returns data about only one id_secr_rqst - I want it to return data about every id_secr_rqst in the table. 2. Limit IMO is mysql specific (I hope I am wrong) is there something generic so I dont need to bother about which database I am running it again

RE: complicated query | no Sub query

2005-05-23 Thread Peter Normann
Hi Anoop Try: SELECT t1.id_secr_rqst, t2.name_rec_type, t1.dt_aud_rec FROM isr2_aud_log t1, isr2_aud_log t2 WHERE t1.id_secr_rqst = t2.id_secr_rqst AND t1.name_rec_type='Exception Resource' ORDER by t1.dt_aud_rec DESC LIMIT 2; Peter Normann -- MySQL General Mailing List For list archives: