Re: using max() on update

2004-07-28 Thread SGreen
d.dateposted set status = 1; > ERROR 1052: Column: 'status' in field list is ambiguous > mysql> > > > > - Original Message ----- > From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > Date: Tue, 27 Jul 2004 09:17:44 -0400 > Subject: Re: using max() on update > To:

Re: using max() on update

2004-07-27 Thread Louie Miranda
in field list is ambiguous mysql> - Original Message - From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Tue, 27 Jul 2004 09:17:44 -0400 Subject: Re: using max() on update To: Louie Miranda <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Here's how I handle these situations.

Re: using max() on update

2004-07-27 Thread SGreen
Here's how I handle these situations. If I need all of the data from the row that contains the maximum of an unindexed column: SELECT @maxval := MAX(column_name) FROM tablename; SELECT * FROM tablename WHERE column_name = @maxval; For the same thing but for an indexed column SELECT * FROM table

using max() on update

2004-07-27 Thread Louie Miranda
Just recently post a problem on how can i see all max(dateposted) on all of my records by doing this.. select datacount,office,filename,status, max(dateposted) from dCOPY group by office; now, i was wondering if i can use max() on update to update all my current records only.. i tried this: my