"Mike Brum" <[EMAIL PROTECTED]> wrote: > Hopefully someone can help me out with this - > > I have two tables in mySQL: comments and diary > > I want to populate a new field in comments with the current values of diary > - but only if they meet certain criteria. > > Now, the problem is this - my webserver is using an older version of mySQL > that doesn't support UPDATEs from multiple tables (that's not possible until > v4.0.4) and unfortunately, them updating the install isn't a possibility. I > know if it was v4.0.4+ I could juse use: > > UPDATE comments,diary > SET comments.diary_date=diary.date > WHERE comments.refid=diary.ID > > I also don't think I can use sub-selects in queries either. > > Btw - I'm currently running v3.23.58.
Use programming language to retrieve data with SELECT statement and then do UPDATE. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]