I Have 2 tables in a mysql database Each one has a column holding urls called url table one has a boolean column What I want to do is search table 2 and if the same url is in both update the boolean field in table1 to 1 any ideas on how to do this? Thanks
Something like this should work. Make sure to do a backup on your tables also. UPDATE my_table SET boolian_column = 1 WHERE url IN ( SELECT url FROM other_table WHERE url = 'someurl.com' ); If you remove the WHERE url = 'someurl.com' this should update every row with a corresponding url in the other table.