+ 3
Can we use "Delete * from table" to delete all data of table?
7 ответов
+ 13
Instead use the drop table command
Syntax
drop tablename;
+ 4
to remove all data of table, you only need to write this
DELETE FROM table_name
ref: https://www.w3schools.com/sql/sql_delete.asp
+ 3
Yes. if you look up the delete statement here https://www.w3schools.com/sql/sql_delete.asp (or in the individual manuals for specific SQL server flavors), you can see the syntax for DELETE:
DELETE FROM table_name
WHERE condition;
Further down the page, it tells you how to delete all rows.
DELETE FROM table_name;
or
DELETE * FROM table_name;
I think this is one of those RTM scenarios, so here are some links to good reference material on SQL:
W3 Schools SQL tutorial and reference:
https://www.w3schools.com/sql/default.asp
MySQL manual:
https://dev.mysql.com/doc/refman/8.0/en/
+ 1
Yes and No. yes you can use delete to eliminate data from a table but if you have an Index and is identity the counter is not restarted. example you have a table and you pk is in 100 if you delete all the data whit the statement delete from tabla and Next you insert a New row the pk contineus whit 101. if you whant yo delete all the data, you need to use Truncate table, this eliminates all the data complety
+ 1
Careful, drop tabla eliminate the table
0
No, you cannot write that. It is because when the statement DELETE FROM TABLE is written, it takes the table as a whole. Moreover, you need to specify a condition to the statement if you want to delete only some specific data.
0
Can you do html and pyhone