how to do group by with the rowid
689201Apr 8 2009 — edited Apr 8 2009CREATE OR REPLACE PROCEDURE DELETE_RECS
AS
BEGIN
DELETE FROM x
WHERE x_date < SYSDATE - 30
AND ROWID NOT IN (SELECT rid
FROM (SELECT ROWID AS rid
FROM x
ORDER BY x_date DESC)
WHERE ROWNUM <= 10);
END;
have to delete the values in the following scnerious. like
group by. e.g
e.g in a table there are group of values say
444 - having 20 rows
555 - having 15 rows
666 - having 17 rows.
should get the result as
444-10 rows with recent dates
555-10 rows with recent dates
666 - 10 rows with recent dates
but the above query deletes only on date. need help to do group by in the inner query
group by x.columnname1,x.columnname2 in the above query