sandy1028 Posted July 20, 2010 Share Posted July 20, 2010 I have two tables in which "id" is constant. Table 1 columns are: id, value_of The value_of column has the values "2010/07/10/name1_abc" Table2 columns are id, key,value_id value_id values are represented as "2010-07-11 00:00:00" Now I have to change the value in table1. select value-of from table1 cv, table2 c where c.id=cv.id and key=28 and c.id=153 This will return the value 2010/07/15/lon-abc. Using the query I have check, if the values of "value_of" column and value_id are equal. If it is not equal then, I should not update "value_of". i.e "value_of" in table1 is "2010/07/10/name1_abc" and value_id is "2010-07-11 00:00:00", then value_of should be changed to "2010/07/11/name1_abc" if YYYY, MM, DD are same in two tables then I should not update the value or else I have to replace it. Link to comment https://forums.phpfreaks.com/topic/208266-update-query/ Share on other sites More sharing options...
fenway Posted July 23, 2010 Share Posted July 23, 2010 Sorry, I don't follow. Link to comment https://forums.phpfreaks.com/topic/208266-update-query/#findComment-1090337 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.