Синтаксис SQL
Note:
Пример SQL
There is a table "Persons":
| P_Id | LastName | FirstName | Address | City |
|---|---|---|---|---|
| 1 | Hansen | Ola | Timoteivn 10 | Sandnes |
| 2 | Svendson | Tove | Borgvn 23 | Sandnes |
| 3 | Pettersen | Kari | Storgt 20 | Stavanger |
| 4 | Nilsen | Johan | Bakken 2 | Stavanger |
| 5 | Tjessem | Jakob | Sandnes |
For this we use this query:
Query Result:
| P_Id | LastName | FirstName | Address | City |
|---|---|---|---|---|
| 1 | Hansen | Ola | Timoteivn 10 | Sandnes |
| 2 | Svendson | Tove | Borgvn 23 | Sandnes |
| 3 | Pettersen | Kari | Storgt 20 | Stavanger |
| 4 | Nilsen | Johan | Bakken 2 | Stavanger |
Note:






Comments
Quote:
That sounds ill!
Wash better way:
So, we want to remove from the table "Persons" all the rows where (in which) LastName = 'Tjessem' and FirstName = 'Jakob'.
or in a notation
So, we want
Persons removed from the table
all rows WHERE LastName = 'Tjessem' and FirstName = 'Jakob'.
Sincerely,
Monarch. Quote
For example, there are two tables - one with data about people, and another - of the city. And you have to delete all entries from the list of people whose city starts with the letter "F".
So I always remember the rules for constructing such a request. Quote
Quote