Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Consulta MySQL LEFT JOIN com cláusula WHERE


Você deseja mover a verificação de data para o local da consulta interna.

Tente 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 ) 
)