SELECT * FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE lds.delivery_id = #{deliveryId} AND lds.reservation_status != 40
SELECT ldr.* FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE lds.delivery_id = #{deliveryId} AND ldr.reservation_status != 40