On 9/7/06, jaro <[EMAIL PROTECTED]> wrote:
> I need all records where B - A = 1
> that can also be  A = B - 1

You don't have to write the entire SQL statement to do this, but (and
admittedly I'm still waking up right now) it's not also doable
directly with the database API; you'd want to use the 'extra'
method[1] to define a custom WHERE clause. But since the custom WHERE
is all you need, you can just do that and let Django handle the rest
of the query.

[1] 
http://www.djangoproject.com/documentation/db_api/#extra-select-none-where-none-params-none-tables-none

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to