Sql select count to python code -


After

I want to know, in a possible way to perform this selection in Python, I know the clinical I want to be more reputed, but it can be in 3 different areas, I know that it works selectively, but I do not know how to put it in Python, or if there is anyone else in Python To do.

  count (*) from (different imp_diagnostica_99, imp_diagnostica_100, imp_diagnostica_101 selected expmedico_expedienteconsultainicial) distinctified  

I process that doctors sent more want to recive.

model.py

  class AutorizacionImagenologia (models.Model): imagenologia_fecha_solicitud_1 = models.DateField (auto_now = true) created_at = models.DateTimeField (auto_now_add = true) = model Updated_at DateField (auto_now = true) imagenologia_fecha_emision = model.defilled (auto_now = true, null = true, blank = true) tipo_plan = m odels.CharField (MAX_LENGTH = 60; null = true, empty = true) empresa_empleadora = models.CharField (MAX_LENGTH = 100, null = true, blank = true) imagenologia_hora_de_solicitud_2 = models.TimeField (auto_now = true, null = true, blank = true) imagenologia_medico_solicita_3 = models.ForeignKey (Medico, related_name = 'MedicoImagenologia', null = true) imagenologia_nombre_pac_4 = Models.CharField (MAX_LENGTH = 60; null = false, empty = true), imagenologia_apellido = models.CharField (MAX_LENGTH = 60; null = false, empty = true), imagenologia_fecha_nacimiento_5 = models.DateField (MAX_LENGTH = 10, null = true, empty = True) imagenologia_edad_miembro6 = models.C Imaginologia_diagnostico_9 = models.CharField (MAX_LENGTH = 100, null = true, empty = true), harField (MAX_LENGTH = 10, null = true, empty = true) imagenologia_sexo_7 = models.CharField (MAX_LENGTH = 10, null = true, Imagenologia_credencial = models.CharField (MAX_LENGTH = 20, null = false) imagenologia_procedimiento = models.ForeignKey (Estudios_Imagenologia, related_name = 'Imagine PR_progressitiento = model.Agariniki (Estudioziosiologia), related_name =' procedural image 3 ', empty = true, empty = true )  

You can always use RawQuerySet with custom models (Only used in the cursor in the cursor.execute ('your_sql_here'):

  connection.cursor () with the cursor as django.db import connection from: this For SQL), or use the Connection Cursor API. Fetchall (): Print 'row field:', row [0], row [1], row [3]  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -