I am trying to delete 41,6% of my old rows from my oracle data table ( senstrig is a date format):
DELETE FROM
(WITH RS AS (SELECT * FROM OLD_WIFISIGN WHERE SENSID= 1 ORDER BY SENSTRIG ASC))
WHERE ROWNUM <= (SELECT COUNT (*)/ 2.4 FROM RS);
But it returns an error:
ORA-00928 missing SELECT
I have already tried several versions but with no luck.
Could you please help me how can I make this "delete from" runnable?
WITH ASsyntax is called a "Common Table Expression" or "CTE"; I've edited the question to include that keyword.