And to finish it off, I just removed pb.ticker="SAP500" statement.
-----Original Message----- From: Pilarinos, Dionysios Sent: Monday, March 01, 2004 4:56 PM To: [EMAIL PROTECTED] Subject: RE: Executing REPLACE from IF statement? After some thought, this is what I came up with: REPLACE current_profile select c.* FROM product_bench pb, current c, bench_current bc WHERE pb.ticker="SAP500" and c.ID=pb.ID and bc.ticker=pb.ticker and DATE_FORMAT(c.mdate,'%m/%d/%Y') = bc.mdate Now all I have to do is make this run for each pb.ticker without having to explicitly identify it in the script. Feel free to give me suggestions. -----Original Message----- From: Pilarinos, Dionysios Sent: Monday, March 01, 2004 3:53 PM To: [EMAIL PROTECTED] Subject: Executing REPLACE from IF statement? Hi, I was wondering if someone can point out a way to make the below script update a row. Query: SELECT pb.ID, c.mdate, bc.mdate, IF(DATE_FORMAT(c.mdate,'%m/%d/%Y') = bc.mdate, "Same Date", "Not Same Date") FROM product_bench pb, current c, bench_current bc WHERE pb.ticker="SAP500" and c.ID=pb.ID and bc.ticker=pb.ticker Result: 97 | 2004-02-21 | 02/21/2004 | Same Date 98 | 2004-02-21 | 02/21/2004 | Same Date What I would like to do is "REPLACE current_profile SELECT * FROM current" where the ID('s) are those returned from the select statement above. Thanks for your insight and assistance. Dionysios Pilarinos ************************************************************** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ************************************************************** -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] ************************************************************** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ************************************************************** -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] ************************************************************** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ************************************************************** -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]