Today we summarize the SQL server2012 version of the database deletion syntax, that is, the use of Delete, we have to delete a data table data, for testing, this is my fifth lesson in learning database, knowledge is power!
Well, let's see what the grammar says!
Database deletion syntax: Delete from a table where the condition is specified.
The above is related to the syntax, as long as the corresponding to the relevant parameters are filled in, but when it comes to conditional query, often still have a lot of complicated situations appear, here to pay attention!
For example, we want to delete this data: (
傅雷家书http://www.simayi.net/duhougan/2654.html读后感1000字
So, how do you write the relevant statements? Let's try it out.
1. First, use DELETE to delete the statement
2. from which table
3, the table name should be dbo.bog.article
4. Where condition query: where id = 2654
OK, the relevant parameters are all done, let's combine these parameters to see what it looks like:
Delete from dbo.bog.article where id = 2654
This is the complete statement, after testing is not a problem, of course, before testing, you should back up the data, and then after testing and then restore the database, about how to back up the database method, has been said before, this is relatively simple.
Here's another note: Delete does not require column names and wildcards, it deletes the entire row instead of the column, deletes the specified column, uses the UPDATE statement, and the DELETE statement deletes rows from the table, or even deletes all rows in the table, rather than deleting the table itself.
Why do you want to learn about SQL database operation syntax? Because we can deal with some data problems in batch, reduce a lot of manual operation and labor, which is very important for us to learn programming, and when we hear that the writing of database statements is very important, in most cases, the related programming work is done by querying, deleting, updating, inserting and other database syntax.
Summary sqlserver2012 Delete syntax: An item in the Delete datasheet