If I have following database fields: id, name, emp_id.
How do I make a query in Django to get the values of column name only with a where clause.
Thanks…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In addition to the answer provided by Ignacio Vazquez-Abrams, you could also use
values_listto get the names in a flat list (instead of a dictionary).See the documentation for
values_list.