I use this to select all the pictures I need and than I move them with some code.
SELECT estate_pictures.picture
FROM estate_pictures
INNER JOIN estate
ON estate_pictures.estate_id=estate.id
WHERE estate.neighborhood
IN (56,57,64,67,68,69,71,73,77,81,83,84,85,86,87,95,96,98,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,118,119,120,121,122,123,124,125,127,128,129,130,131,132)
After that I want to delete all the lines that come up in:
SELECT *
FROM estate_pictures
INNER JOIN estate
ON estate_pictures.estate_id=estate.id
WHERE estate.neighborhood
IN (56,57,64,67,68,69,71,73,77,81,83,84,85,86,87,95,96,98,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,118,119,120,121,122,123,124,125,127,128,129,130,131,132)
Would just putting "DELETE" instead of "SELECT *" work or is there something more to change for this to work. I'm not clear on how to back up the database yet, so I'd like to be sure it works before I do a DELETE query. Its not like the SELECT ones. I.E. would this work:
DELETE
FROM estate_pictures
INNER JOIN estate
ON estate_pictures.estate_id=estate.id
WHERE estate.neighborhood
IN (56,57,64,67,68,69,71,73,77,81,83,84,85,86,87,95,96,98,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,118,119,120,121,122,123,124,125,127,128,129,130,131,132)