Query the records of a table deleted by mistake during a certain period of time!

Source: Internet
Author: User

Sometimes some data in a table is accidentally deleted during database operations, in this case, you can query the records of a table deleted by mistake in a certain period of time to restore the data.

 

The SQL statement used to query records of tables accidentally deleted in a certain period of time is as follows:

Select * From table_name as of Timestamp to_timestamp (timestamp_value, 'yyyy-MM-DD hh24: MI: ss ');

 

Note: This statement only applies when table_name has a real deletion record. Otherwise, it cannot be executed.

 

 

In addition, when querying a table, you may need to filter out pure and non-full numbers. You can use the functions provided in Oracle to complete this function.

Translate (<column_name>, 'a0124356789 ', 'A ')

 

This function is used to query non-numeric content and numeric content in a field value. If it is all numeric content, it is null. Otherwise, only the non-numeric part is retrieved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.