Skip to Main Content

Breadcrumb

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 100+ 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 we 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.

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