Doug,

Try the syntax:

    UPDATE tablename SET columnname = value

Since there is no "WHERE" clause, this will affect every record in the 
table. A simple example (since I'm not familiar with the INTERVAL 
function) of updating a INT column called Score to add "2" to every 
record in table Football would look like:

    UPDATE Football SET Score = Score + 2

Hope that helps. Let me know if you need more info.

Best regards,
Jim at iDimensionz.com
-- 
http://www.iDimensionz.com Professional web site design and affordable 
web site hosting.
------------------------------------------------------------------------
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id=38044&t=84> 
– Get the new open source web browser, FireFox, and enjoy features like 
pop up blocking, tabbed browsing and MUCH more!
Get Thunderbird! 
<http://www.spreadfirefox.com/?q=affiliates&id=38044&t=178> – Get the 
new open source e-mail client, ThunderBird, and enjoy features like 
integrated spam filter, privacy protection, integrated RSS reader and 
MUCH more!

Ski Dawg wrote:

> Hello Everyone,
>
> I have a few thousand database (MySQL 4.0.16) records that I need to
> update. The fields are datetime type. I need to subtract 2 hours from
> each field (to mark changing time zones). Is there something like a
> UPDATE..SELECT (like the INSERT..SELECT) so I can just change the
> records with a single SQL statement?
>
> I know how I can use the INTERVAL function in the SELECT statement to
> get the time difference, but I am not sure how to update the record
> without some PHP processing.
>
> Anyone have any ideas how to do this with just SQL?
> --
> Doug
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/CefplB/TM
--------------------------------------------------------------------~-> 

The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to