我想知道是否有一種可能的方式來做這個選擇在Python中的功能,我想知道更有名的診斷,但它可以在3個不同的領域,我知道這個選擇可以工作,但我不知道如何將它放入Python中,或者如果還有其他什麼東西在Python中執行相同的操作。SQL選擇計數到python代碼
SELECT Count(*)
FROM (
SELECT DISTINCT
imp_diagnostica_99
, imp_diagnostica_100
, imp_diagnostica_101
FROM expmedico_expedienteconsultainicial
) As distinctified
我想獲得醫生髮送更多的程序。
model.py
class AutorizacionImagenologia(models.Model):
imagenologia_fecha_solicitud_1 = models.DateField(auto_now=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateField(auto_now=True)
imagenologia_fecha_emision = models.DateField(auto_now=True, null=True, blank=True)
tipo_plan = models.CharField(max_length=60, null=True, blank=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, blank=True)
imagenologia_apellido = models.CharField(max_length=60, null=False, blank=True)
imagenologia_fecha_nacimiento_5 = models.DateField(max_length=10, null=True, blank=True)
imagenologia_edad_miembro6 = models.CharField(max_length=10, null=True, blank=True)
imagenologia_sexo_7 = models.CharField(max_length=10, null=True, blank=True)
imagenologia_diagnostico_9 = models.CharField(max_length=100, null=True, blank=True)
imagenologia_credencial = models.CharField(max_length=20, null=False)
imagenologia_procedimiento = models.ForeignKey(
Estudios_Imagenologia,
related_name='ProcedimientosImg', blank=True, null=True)
imagenologia_procedimiento2 = models.ForeignKey(Estudios_Imagenologia, related_name='ProcedimientosImg2', blank=True, null=True)
imagenologia_procedimiento3 = models.ForeignKey(
Estudios_Imagenologia, related_name='ProcedimientosImg3',
blank=True, null=True)