I have the following query:
SELECT * FROM activities_misc a
left join AttachmentLinks as b on a.act_misc_id = b.Object_id
left join Attachments as c on c.attachment_id = b.attachment_id
WHERE Firmid = 2 AND Caseid = 10062
ORDER BY act_misc_id desc
I want to do the first join to Attachmentlinks ONLY when b.Object_type = 'receipt'
How would the syntax be ?