Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #10  
Antiguo 29-09-2004
[basti] basti is offline
Miembro Premium
 
Registrado: ago 2004
Posts: 388
Poder: 20
basti Va por buen camino
Si no entiendo mal, la tabla MateriaProfesor es la que tiene todas las clases a las que deberían asistir los profesores. Entonces la tabla MateriaProfesor debería ser la única de la clausula FROM. Además si pones el filtro ASI_FechaEntrada = '09/09/2004', no te mostrará los que no se encuentran en la tabla Asistencia, creo que debería funcionar de la siguiente manera:

Código SQL [-]
 Select DatosPersonales_id, DAT_Apellido + ', ' + DAT_Nombres,ASI_id_Profesor,ASI_HoraEntrada,ASI_FechaEntrada,
 MPR_Dia, MPR_Division
 From  MateriaProfesor.db
 left outer join Profesores.db on
   MPR_id_Profesor = Profesores_id
 left outer join Asistencia.db on
   ASI_id_Profesor = Profesores_id
 left outer JOIN DatosPersonales.db on
   pro_id_DatosPersonales = DatosPersonales_id
 left outer join Materias.db on
   MPR_id_Materia = Materias_Id
 where  (ASI_FechaEntrada = '09/09/2004'  or 
              MPR_id_Profesor not in (select ASI_id_Profesor from Asistencia.db 
                                            where ASI_FechaEntrada = '09/09/2004'))

     and  MPR_Dia = 'Jueves'
     and PRO_Condicion0 = 'A'
     and  MPR_Turno = 'T'

un saludo
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 16:43:49.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi