I'm learning MySQL add this this year. I'm trying to delete the results I got from this select statement:
select distinct *
from films a
inner join films b
on trim(upper(a.titel)) = trim(upper(b.titel))
where a.filmID > b.filmID
But their are a few problems: the database that we use is broken and contains many errors. For that reason testing out code will not always have the results we need. So we basically are running blind and just have the solve the questions without been able to test them properly.
Since our deadline is tomorrow we solved all questions except for this one. I wanted to solve this issue by doing this:
delete from films where (*) in (
select distinct *
from films a
inner join films b
on trim(upper(a.titel)) = trim(upper(b.titel))
where a.filmID > b.filmID
);
And now I get this error:
My classmates think it's just an error in the database. But I suspect that's not the case.
Then I tried this:
delete from films where titel in (
select distinct a.titel
from films a
inner join films b
on trim(upper(a.titel)) = trim(upper(b.titel))
where a.filmID > b.filmID
);
With this error: