sql >> Base de Datos >  >> RDS >> Mysql

MySQL LEFT JOIN Consulta con cláusula WHERE

Desea mover la verificación de fecha al lugar de la consulta interna.

Prueba algo como:

SELECT member.*,card.* 
FROM member 
LEFT JOIN member_card card on card.member=member.id
WHERE member.id IN (
    SELECT DISTINCT m.id FROM Member m
        LEFT JOIN Member_Card mc ON (mc.Member = m.id)
        WHERE ( m.LastModifiedDate >= sinceDate  
        OR mc.LastModifiedDate >= sinceDate ) 
)