Removing duplicates from query without using HSQLDB?

pierre! amazing it deleted everything. Worked fine.
However, I have a doubt. Imagine I want to make the deletion in a saved query? what should I do?
I tried your code, adding the select statement.

SELECT “ID”, “Fruit”
DELETE FROM “Table2”
WHERE “ID” NOT IN ( SELECT MIN( “ID” ) FROM “Table2” GROUP BY “Fruit” )
It did not worked. Again, show me only the duplicated records, with an “Alias” that says DELETE.
What is wrong?

@mrmister - Without programming it is not possible. You can only run select queries.

Is that correct? I would need you please, clarify me this. Again, thanks a lot for the deletion code. :smiley:

@mrmister I do not understand “Is that correct”. Queries run from the interface have to produce a data set from a SELECT statement (the result may possibly not contain any data). Other requests must be launched from the Tools menu. This is the reason I first gave you the query to select that makes it easy to delete.