My example:
Table A: post_id
Table B: id + delete(null)
- In that, post_id = id
I want to delete all rows for both tables where A.deleted != 'null'
I tried: Delete A, B FROM A LEFT JOIN B ON B.post_id = A.id WHERE A.deleted != 'null' - but not work
My example:
Table A: post_id
Table B: id + delete(null)
I want to delete all rows for both tables where A.deleted != 'null'
I tried: Delete A, B FROM A LEFT JOIN B ON B.post_id = A.id WHERE A.deleted != 'null' - but not work
If your no record fetch for delete != 'null' then you should add deleted is not null OR delete != 'null'
You can not check null value with == or != operator you need to use is or is not for this kind of filtration
Delete A, B
FROM A LEFT JOIN B ON B.post_id = A.id
WHERE A.deleted is not null OR A.deleted != 'null'