Thursday, June 24, 2010

Re: How to do select from table where something in ('What','When','Where')

tableA.objects.filter(columnA__in=['Value1', 'Value2', 'Value3'])

http://docs.djangoproject.com/en/1.2/ref/models/querysets/#in

On Jun 24, 2010, at 4:18 PM, thusjanthan wrote:

> Hi,
>
> Can someone provide the syntax for doing the following in django
> queries:
>
> Select * from tableA where columnA in ('Value1','Value2','Value3')
>
> Cheers,
> nathan.
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment