Sunday, May 27, 2012

Database Query in Shell

I have a table Amounts which has 2 columns field and other_field.
These columns are filled in such a way that either other_field is null
or other_field = field.
I want to make a database query such that

if field == other_field :
field = "OTHER"
else:
field = field

That means the entries in table where 2 columns are equal, there field
should be assigned a string "OTHER" and other_field should remain as
such.
How can I give such query in shell.

--
Sandeep Kaur
E-Mail: mkaurkhalsa@gmail.com
Blog: sandymadaan.wordpress.com

--
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