Skip to Main Content

Breadcrumb

XMAS_TREE

The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.

Question and Answer

Connor McDonald

Thanks for the question.

Asked: May 07, 2021 - 9:52 am UTC

Last updated: May 10, 2021 - 9:02 am UTC

Version: na

Viewed 1000+ times

You Asked

with this normal query of delete

delete from table where condition-'a';

will it work in table data are present from year 2014.
i want to delete all data starting from 2014 to till now.

and Connor said...

You need *something* in that table that tells you what year the data was inserted.

If it was (say) a DATE column you could do something like

delete from table
where my_date_col >= date '01-01-2014'
and my_date_col < date '01-01-2015'


but there is nothing internally stored in the database which indicates the time at which data was created.

We're not taking comments currently, so please try again later if you want to add a comment.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library