diff options
| author | Gultask <100873791+Gultask@users.noreply.github.com> | 2023-01-05 16:11:15 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-05 16:11:15 -0300 |
| commit | b9c48af6faca1d21b142235de48a4d7ef5a321fb (patch) | |
| tree | e50b77a45df7aec9f30558f573c66ab72ff7d9f9 /docs | |
| parent | c689a45de588867062ecd30f1b9d989f77f32981 (diff) | |
| download | wiki-b9c48af6faca1d21b142235de48a4d7ef5a321fb.tar.gz wiki-b9c48af6faca1d21b142235de48a4d7ef5a321fb.tar.bz2 wiki-b9c48af6faca1d21b142235de48a4d7ef5a321fb.zip | |
Adds details for better DELETE queries in sql-standards.md (#850)
* Add specification to DELETE queries
* Update sql-standards.md
* Update sql-standards.md
* Update sql-standards.md
* Update sql-standards.md
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/sql-standards.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/sql-standards.md b/docs/sql-standards.md index 42e24a2..b97c76b 100644 --- a/docs/sql-standards.md +++ b/docs/sql-standards.md @@ -32,6 +32,21 @@ DELETE FROM `creature_loot_template` WHERE `entry` = 3 AND `item` = 884; INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES (3, 884, 0, 40, 1, 1, 0, 1, 1, 'Comment'); ``` +--- + +When performing DELETE queries, always specify more than one field. In particular, specify at least one primary key present in the table and another accompanying field. + +Wrong: + +```sql +DELETE FROM `creature_loot_template` WHERE `item` = 884; +``` + +Correct: + +```sql +DELETE FROM `creature_loot_template` WHERE `entry` = 3 AND `item` = 884; +``` ### UPDATE |
