TRUNCATE:
It is used to delete all the records from the table without deleting the table structure.
It clears the auto generated numbers also where delete will delete all or few records without clearing the auto generation of numbers.
Syntax for truncate:
TRUNCATE TABLE <TABLE_NAME>
example:
truncate table emp20--It will delete all the rows from the table,we can't use where clause.
select * from emp20-herew e wont get any data.
we will see more about auto numbers in next article.
Thanks
GSV
It is used to delete all the records from the table without deleting the table structure.
It clears the auto generated numbers also where delete will delete all or few records without clearing the auto generation of numbers.
Syntax for truncate:
TRUNCATE TABLE <TABLE_NAME>
example:
truncate table emp20--It will delete all the rows from the table,we can't use where clause.
select * from emp20-herew e wont get any data.
we will see more about auto numbers in next article.
Thanks
GSV
No comments:
Post a Comment