summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-20 10:28:23 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-20 10:28:23 -0800
commitc03edb58f11c76ab8041a94fbb2ed51cff452e6f (patch)
tree8c06c08217b298aa79416d12df0e46a9ff0bc32e
parent3841feee86cae65165f120db7a5d80ffc76dd520 (diff)
parent6dfd02f88c49ce0d39191088863f6f45b0d7784e (diff)
Merge pull request #2332 from davesque/sql-doc-fixes
Capitalize SQL keywords
-rw-r--r--docs/topics/db/sql.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt
index 1b806ca42f..9245037d59 100644
--- a/docs/topics/db/sql.txt
+++ b/docs/topics/db/sql.txt
@@ -105,13 +105,13 @@ Index lookups
``raw()`` supports indexing, so if you need only the first result you can
write::
- >>> first_person = Person.objects.raw('SELECT * from myapp_person')[0]
+ >>> first_person = Person.objects.raw('SELECT * FROM myapp_person')[0]
However, the indexing and slicing are not performed at the database level. If
you have a large number of ``Person`` objects in your database, it is more
efficient to limit the query at the SQL level::
- >>> first_person = Person.objects.raw('SELECT * from myapp_person LIMIT 1')[0]
+ >>> first_person = Person.objects.raw('SELECT * FROM myapp_person LIMIT 1')[0]
Deferring model fields
----------------------
@@ -274,11 +274,11 @@ names, which means you end up with a ``list`` of values, rather than a
Here is an example of the difference between the two::
- >>> cursor.execute("SELECT id, parent_id from test LIMIT 2");
+ >>> cursor.execute("SELECT id, parent_id FROM test LIMIT 2");
>>> cursor.fetchall()
((54360982L, None), (54360880L, None))
- >>> cursor.execute("SELECT id, parent_id from test LIMIT 2");
+ >>> cursor.execute("SELECT id, parent_id FROM test LIMIT 2");
>>> dictfetchall(cursor)
[{'parent_id': None, 'id': 54360982L}, {'parent_id': None, 'id': 54360880L}]