Say that your first table will contain the maximum date from the second table, and that there is a one-to-many relationship: field t1id in the second table refers to field id in the first table. Here's the SQL to update all max_date fields in the first table:
UPDATE t1 JOIN ( SELECT t2.t1id, MAX(t2.thedate) maxdate FROM t2 GROUP BY t2.t1id ) AS agg ON t1.id=agg.t1id SET t1.max_date=agg.maxdate
I hope that this proves useful; let me know if it does!
Disclaimer: I won't be help responsible for any loss of data or time you suffer as a result of following my advice!
Simple Programming Exercises (more)
Technology The modern world is supported and influenced by technology in a wide variety of ways. Almost nobody in the developed nations can claim to be free of technology, and in fact most homes are stuffed with highly advanced gadgets and ... (more)
Computer and Web Programming (more)
Web Programming This section is all about web development, helping programmers to develop the best sites possible. The key elements of successful web development: Performance - Interface - Maintainability (more)
I was fortunate enough to attend the PHP UK Conference 2012, on Friday 24 February. The theme of the conference was about how well PHP scales; watch the two keynote speeches by Rasmus Lerdorf (PHP founder) and Hugh Williams (eBay's Engineering ... (more)
Greenland has its very own computing influencer! Way back in 1995, Rasmus Lerdorf got PHP (PHP Hypertext Preprocessor) off the ground and thus paved the way for a blindingly simple way to do web programming. PHP placed the emphasis of website ... (more)
Does your company have a local presence in many different countries, or do you run a site where it makes sense to keep visitors from different countries away from each other? There are a number of follow-on questions here. Does it matter ... (more)
Here are the command-line steps needed to get a bare Rackspace Cloud CentOS 5.5 image ready for full LAMP (Apache-MySQL-PHP) hosting: (Note - replace mysite.com with the domain name of your own website) yum install rsync yum install mysql ... (more)
Cloud computing promises much for the budget-conscious web publisher. It should allow - within reason - a flexibility of resource availability so that bursts in traffic are absorbed by spare computing utility. In practice, the publisher still ... (more)
Install imagemagick Create a destination directory for the images Create a batch file (eg, C:\webimage.bat) with this line in it: convert %~nx1 -resize 900x700 C:\web\%~nx1 Download and install ContextEdit: http://www.softpedia.com/progDownload ... (more)
The SANS Institute has published a list of the 25 most dangerous programming errors - and how to fix them. See CWE/SANS TOP 25 Most Dangerous Programming Errors. Two of the errors accounted for 1.5 million breaches during 2008, so it is important ... (more)
It's really easy to integrate Twitter notifications into your own web app. For the source code have a look at Programming with the Twitter API. (more)
The United States Energy Policy Act of 2005 established new rules for Daylight Savings Time (DST) in the US. These new rules change the start and end dates for DST beginning 2007. This year, DST will start on the second Sunday of March and ... (more)
Code from this page: Build a Site Search with the Google Search API (more)