Skip to Main Content

Breadcrumb

May 4th

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.

Is this answer out of date? If it is, please let us know via 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